svn merge ^/trunk/blender -r43472:43482
authorCampbell Barton <ideasman42@gmail.com>
Wed, 18 Jan 2012 07:04:17 +0000 (07:04 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 18 Jan 2012 07:04:17 +0000 (07:04 +0000)
17 files changed:
build_files/cmake/project_info.py
build_files/cmake/project_source_info.py
extern/carve/bundle.sh
extern/carve/patches/gcc46.patch [new file with mode: 0644]
extern/carve/patches/mingw.patch [new file with mode: 0644]
extern/carve/patches/series
release/scripts/modules/addon_utils.py
release/scripts/modules/bpy/utils.py
release/scripts/startup/bl_ui/__init__.py
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_paint_common.py [new file with mode: 0644]
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/blenkernel/intern/text.c
source/blender/gpu/intern/gpu_codegen.c

index 65afd109302595698839d068450d57cd7cbdd670..77574f17e2e4f336fde3c262d0fcffd4a8a4ea39 100755 (executable)
@@ -133,7 +133,7 @@ def cmake_advanced_info():
     """ Extracr includes and defines from cmake.
     """
 
-    def create_eclipse_project(CMAKE_DIR):
+    def create_eclipse_project():
         print("CMAKE_DIR %r" % CMAKE_DIR)
         if sys.platform == "win32":
             cmd = 'cmake "%s" -G"Eclipse CDT4 - MinGW Makefiles"' % CMAKE_DIR
@@ -145,7 +145,7 @@ def cmake_advanced_info():
     includes = []
     defines = []
 
-    create_eclipse_project(CMAKE_DIR)
+    create_eclipse_project()
 
     from xml.dom.minidom import parse
     tree = parse(join(CMAKE_DIR, ".cproject"))
index a39ed94bd69d05a1ad8328ad42cb81a87ed97a5c..ed17ec5bac4bd4d043e72b4728da9d7586c04e62 100644 (file)
@@ -160,7 +160,6 @@ def build_info(use_c=True, use_cxx=True, ignore_prefix_list=None):
 def queue_processes(process_funcs, job_total=-1):
     """ Takes a list of function arg pairs, each function must return a process
     """
-    import sys
 
     if job_total == -1:
         import multiprocessing
index cbc1fe6d2d59e2e7a6f992c95c80a4bea8fe6f2f..3f9028619a53892ff314116ca92d61023f73c34e 100755 (executable)
@@ -114,7 +114,8 @@ incs = ['include']
 if env['WITH_BF_BOOST']:
     if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'):
         # Boost is setting as preferred collections library in the Carve code when using MSVC compiler
-        defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
+        if env['OURPLATFORM'] != 'win32-mingw':
+            defs.append('HAVE_BOOST_UNORDERED_COLLECTIONS')
 
     defs.append('CARVE_SYSTEM_BOOST')
     incs.append(env['BF_BOOST_INC'])
diff --git a/extern/carve/patches/gcc46.patch b/extern/carve/patches/gcc46.patch
new file mode 100644 (file)
index 0000000..a8384dc
--- /dev/null
@@ -0,0 +1,11 @@
+diff -r 525472fb477a include/carve/polyline_iter.hpp
+--- a/include/carve/polyline_iter.hpp  Sun Jan 15 23:07:40 2012 -0500
++++ b/include/carve/polyline_iter.hpp  Wed Jan 18 00:41:13 2012 +0600
+@@ -20,6 +20,7 @@
+ #include <list>
+ #include <iterator>
+ #include <limits>
++#include <cstddef>
+ #include <carve/polyline_decl.hpp>
diff --git a/extern/carve/patches/mingw.patch b/extern/carve/patches/mingw.patch
new file mode 100644 (file)
index 0000000..c237edf
--- /dev/null
@@ -0,0 +1,15 @@
+diff -r 525472fb477a include/carve/win32.h
+--- a/include/carve/win32.h    Sun Jan 15 23:07:40 2012 -0500
++++ b/include/carve/win32.h    Wed Jan 18 00:40:10 2012 +0600
+@@ -8,9 +8,11 @@
+ #include <string.h>
+ #include <stdlib.h>
++#if !defined(__MINGW32__)
+ inline int strcasecmp(const char *a, const char *b) {
+   return _stricmp(a,b);
+ }
++#endif
+ inline void srandom(unsigned long input) {
+   srand(input);
index 6e2a36a057685159f1866e29494f44ecc059baad..585d90659bd9ebfc74745df3496ed4879a218b3e 100644 (file)
@@ -2,3 +2,5 @@ strict_flags.patch
 includes.patch
 win32.patch
 mesh_iterator.patch
+mingw.patch
+gcc46.patch
index b64b32b31267841f656a0d706f6b1102d64941e4..2b1616a0022b41859380ef9cde0730a2a1c2e4fc 100644 (file)
@@ -38,17 +38,17 @@ addons_fake_modules = {}
 
 def paths():
     # RELEASE SCRIPTS: official scripts distributed in Blender releases
-    paths = _bpy.utils.script_paths("addons")
+    addon_paths = _bpy.utils.script_paths("addons")
 
     # CONTRIB SCRIPTS: good for testing but not official scripts yet
     # if folder addons_contrib/ exists, scripts in there will be loaded too
-    paths += _bpy.utils.script_paths("addons_contrib")
+    addon_paths += _bpy.utils.script_paths("addons_contrib")
 
     # EXTERN SCRIPTS: external projects scripts
     # if folder addons_extern/ exists, scripts in there will be loaded too
-    paths += _bpy.utils.script_paths("addons_extern")
+    addon_paths += _bpy.utils.script_paths("addons_extern")
 
-    return paths
+    return addon_paths
 
 
 def modules(module_cache):
index 442d257b237c74bb1a6b78b0b15e1f4059487bf8..d5abcb03164e7697d5352b134a57c42daa8f90cf 100644 (file)
@@ -281,10 +281,7 @@ def script_paths(subdir=None, user_pref=True, check_all=False):
     prefs = _bpy.context.user_preferences
 
     # add user scripts dir
-    if user_pref:
-        user_script_path = prefs.filepaths.script_directory
-    else:
-        user_script_path = None
+    user_script = prefs.filepaths.script_directory if user_pref else None
 
     if check_all:
         # all possible paths
@@ -294,7 +291,7 @@ def script_paths(subdir=None, user_pref=True, check_all=False):
         # only paths blender uses
         base_paths = _bpy_script_paths()
 
-    for path in base_paths + (user_script_path, ):
+    for path in base_paths + (user_script, ):
         if path:
             path = _os.path.normpath(path)
             if path not in scripts and _os.path.isdir(path):
@@ -303,13 +300,13 @@ def script_paths(subdir=None, user_pref=True, check_all=False):
     if subdir is None:
         return scripts
 
-    script_paths = []
+    scripts_subdir = []
     for path in scripts:
         path_subdir = _os.path.join(path, subdir)
         if _os.path.isdir(path_subdir):
-            script_paths.append(path_subdir)
+            scripts_subdir.append(path_subdir)
 
-    return script_paths
+    return scripts_subdir
 
 
 def refresh_script_paths():
@@ -464,7 +461,7 @@ def keyconfig_set(filepath):
     keyconfigs.active = kc_new
 
 
-def user_resource(type, path="", create=False):
+def user_resource(resource_type, path="", create=False):
     """
     Return a user resource path (normally from the users home directory).
 
@@ -479,7 +476,7 @@ def user_resource(type, path="", create=False):
     :rtype: string
     """
 
-    target_path = _user_resource(type, path)
+    target_path = _user_resource(resource_type, path)
 
     if create:
         # should always be true.
index 6aa08a7f50da615d42d9b476944b490ac7a25eba..84049e9f1fec6dd8e468f17b8974a3cc7e6d9049 100644 (file)
@@ -86,7 +86,7 @@ def register():
 
     # space_userprefs.py
     from bpy.props import StringProperty, EnumProperty
-    WindowManager = bpy.types.WindowManager
+    from bpy.types import WindowManager
 
     def addon_filter_items(self, context):
         import addon_utils
index 9f2b3367feb40c6a72144fbc6ce95f788c9e346a..ee5702e324e9e224c7641e953c54267b7d65717b 100644 (file)
@@ -244,7 +244,7 @@ class RenderButtonsPanel():
         return (rd.engine in cls.COMPAT_ENGINES)
 
 
-class RENDER_PT_embedded(RenderButtonsPanel, bpy.types.Panel):
+class RENDER_PT_embedded(RenderButtonsPanel, Panel):
     bl_label = "Embedded Player"
     COMPAT_ENGINES = {'BLENDER_GAME'}
 
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
new file mode 100644 (file)
index 0000000..25ea85a
--- /dev/null
@@ -0,0 +1,61 @@
+# ##### 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>
+
+
+class UnifiedPaintPanel():
+    # subclass must set
+    # bl_space_type = 'IMAGE_EDITOR'
+    # bl_region_type = 'UI'
+
+    @staticmethod
+    def paint_settings(context):
+        toolsettings = context.tool_settings
+
+        if context.sculpt_object:
+            return toolsettings.sculpt
+        elif context.vertex_paint_object:
+            return toolsettings.vertex_paint
+        elif context.weight_paint_object:
+            return toolsettings.weight_paint
+        elif context.image_paint_object:
+            return toolsettings.image_paint
+        elif context.particle_edit_object:
+            return toolsettings.particle_edit
+
+        return None
+
+    @staticmethod
+    def unified_paint_settings(parent, context):
+        ups = context.tool_settings.unified_paint_settings
+        parent.label(text="Unified Settings:")
+        parent.prop(ups, "use_unified_size", text="Size")
+        parent.prop(ups, "use_unified_strength", text="Strength")
+
+    @staticmethod
+    def prop_unified_size(parent, context, brush, prop_name, icon='NONE', text="", slider=False):
+        ups = context.tool_settings.unified_paint_settings
+        ptr = ups if ups.use_unified_size else brush
+        parent.prop(ptr, prop_name, icon=icon, text=text, slider=slider)
+
+    @staticmethod
+    def prop_unified_strength(parent, context, brush, prop_name, icon='NONE', text="", slider=False):
+        ups = context.tool_settings.unified_paint_settings
+        ptr = ups if ups.use_unified_strength else brush
+        parent.prop(ptr, prop_name, icon=icon, text=text, slider=slider)
index c7f94bb4a3d6919b72daca26f8f98760ec4232c2..6e54bdde024875990a323d20538c3c1c3a20a2a6 100644 (file)
 # <pep8 compliant>
 import bpy
 from bpy.types import Menu, Panel
+
+from bpy.types import (Brush,
+                       Lamp,
+                       Material,
+                       ParticleSettings,
+                       Texture,
+                       World)
+
 from rna_prop_ui import PropertyPanel
 
 
@@ -91,7 +99,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel):
         engine = context.scene.render.engine
         if not (hasattr(context, "texture_slot") or hasattr(context, "texture_node")):
             return False
-        return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, bpy.types.ParticleSettings))
+        return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, ParticleSettings))
             and (engine in cls.COMPAT_ENGINES))
 
     def draw(self, context):
@@ -103,14 +111,14 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel):
         idblock = context_tex_datablock(context)
         pin_id = space.pin_id
 
-        if space.use_pin_id and not isinstance(pin_id, bpy.types.Texture):
+        if space.use_pin_id and not isinstance(pin_id, Texture):
             idblock = pin_id
             pin_id = None
 
         if not space.use_pin_id:
             layout.prop(space, "texture_context", expand=True)
 
-        tex_collection = (pin_id is None) and (node is None) and (not isinstance(idblock, bpy.types.Brush))
+        tex_collection = (pin_id is None) and (node is None) and (not isinstance(idblock, Brush))
 
         if tex_collection:
             row = layout.row()
@@ -413,7 +421,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
         col = split.column()
 
         #Only for Material based textures, not for Lamp/World...
-        if slot and isinstance(idblock, bpy.types.Material):
+        if slot and isinstance(idblock, Material):
             col.prop(tex, "use_normal_map")
             row = col.row()
             row.active = tex.use_normal_map
@@ -801,7 +809,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
     @classmethod
     def poll(cls, context):
         idblock = context_tex_datablock(context)
-        if isinstance(idblock, bpy.types.Brush) and not context.sculpt_object:
+        if isinstance(idblock, Brush) and not context.sculpt_object:
             return False
 
         if not getattr(context, "texture_slot", None):
@@ -818,7 +826,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
         tex = context.texture_slot
         # textype = context.texture
 
-        if not isinstance(idblock, bpy.types.Brush):
+        if not isinstance(idblock, Brush):
             split = layout.split(percentage=0.3)
             col = split.column()
             col.label(text="Coordinates:")
@@ -847,7 +855,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
                 split.label(text="Object:")
                 split.prop(tex, "object", text="")
 
-        if isinstance(idblock, bpy.types.Brush):
+        if isinstance(idblock, Brush):
             if context.sculpt_object:
                 layout.label(text="Brush Mapping:")
                 layout.prop(tex, "map_mode", expand=True)
@@ -856,7 +864,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel, Panel):
                 row.active = tex.map_mode in {'FIXED', 'TILED'}
                 row.prop(tex, "angle")
         else:
-            if isinstance(idblock, bpy.types.Material):
+            if isinstance(idblock, Material):
                 split = layout.split(percentage=0.3)
                 split.label(text="Projection:")
                 split.prop(tex, "mapping", text="")
@@ -889,7 +897,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
     @classmethod
     def poll(cls, context):
         idblock = context_tex_datablock(context)
-        if isinstance(idblock, bpy.types.Brush):
+        if isinstance(idblock, Brush):
             return False
 
         if not getattr(context, "texture_slot", None):
@@ -915,7 +923,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
             sub.prop(tex, factor, text=name, slider=True)
             return sub  # XXX, temp. use_map_normal needs to override.
 
-        if isinstance(idblock, bpy.types.Material):
+        if isinstance(idblock, Material):
             if idblock.type in {'SURFACE', 'WIRE'}:
                 split = layout.split()
 
@@ -978,7 +986,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
                 factor_but(col, "use_map_color_transmission", "transmission_color_factor", "Transmission Color")
                 factor_but(col, "use_map_color_reflection", "reflection_color_factor", "Reflection Color")
 
-        elif isinstance(idblock, bpy.types.Lamp):
+        elif isinstance(idblock, Lamp):
             split = layout.split()
 
             col = split.column()
@@ -987,7 +995,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
             col = split.column()
             factor_but(col, "use_map_shadow", "shadow_factor", "Shadow")
 
-        elif isinstance(idblock, bpy.types.World):
+        elif isinstance(idblock, World):
             split = layout.split()
 
             col = split.column()
@@ -997,7 +1005,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
             col = split.column()
             factor_but(col, "use_map_zenith_up", "zenith_up_factor", "Zenith Up")
             factor_but(col, "use_map_zenith_down", "zenith_down_factor", "Zenith Down")
-        elif isinstance(idblock, bpy.types.ParticleSettings):
+        elif isinstance(idblock, ParticleSettings):
             split = layout.split()
 
             col = split.column()
@@ -1028,7 +1036,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
 
         layout.separator()
 
-        if not isinstance(idblock, bpy.types.ParticleSettings):
+        if not isinstance(idblock, ParticleSettings):
             split = layout.split()
 
             col = split.column()
@@ -1041,10 +1049,10 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
             col.prop(tex, "invert", text="Negative")
             col.prop(tex, "use_stencil")
 
-        if isinstance(idblock, bpy.types.Material) or isinstance(idblock, bpy.types.World):
+        if isinstance(idblock, Material) or isinstance(idblock, World):
             col.prop(tex, "default_value", text="DVar", slider=True)
 
-        if isinstance(idblock, bpy.types.Material):
+        if isinstance(idblock, Material):
             layout.label(text="Bump Mapping:")
 
             # only show bump settings if activated but not for normal-map images
@@ -1063,7 +1071,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
 class TEXTURE_PT_custom_props(TextureButtonsPanel, PropertyPanel, Panel):
     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
     _context_path = "texture"
-    _property_type = bpy.types.Texture
+    _property_type = Texture
 
 if __name__ == "__main__":  # only for live edit.
     bpy.utils.register_module(__name__)
index b5e23f146b13b6f517d243571bc95188dded57e8..55c10a560154c1c8439819f51b945d010e7823c8 100644 (file)
@@ -117,7 +117,7 @@ class CLIP_PT_tools_marker(Panel):
         if settings.show_default_expanded:
             col = box.column()
             row = col.row(align=True)
-            label = bpy.types.CLIP_MT_tracking_settings_presets.bl_label
+            label = CLIP_MT_tracking_settings_presets.bl_label
             row.menu('CLIP_MT_tracking_settings_presets', text=label)
             row.operator("clip.tracking_settings_preset_add",
                          text="", icon='ZOOMIN')
@@ -999,7 +999,7 @@ class CLIP_MT_camera_presets(Menu):
     bl_label = "Camera Presets"
     preset_subdir = "tracking_camera"
     preset_operator = "script.execute_preset"
-    draw = bpy.types.Menu.draw_preset
+    draw = Menu.draw_preset
 
 
 class CLIP_MT_track_color_presets(Menu):
@@ -1007,7 +1007,7 @@ class CLIP_MT_track_color_presets(Menu):
     bl_label = "Color Presets"
     preset_subdir = "tracking_track_color"
     preset_operator = "script.execute_preset"
-    draw = bpy.types.Menu.draw_preset
+    draw = Menu.draw_preset
 
 
 class CLIP_MT_tracking_settings_presets(Menu):
@@ -1015,7 +1015,7 @@ class CLIP_MT_tracking_settings_presets(Menu):
     bl_label = "Tracking Presets"
     preset_subdir = "tracking_settings"
     preset_operator = "script.execute_preset"
-    draw = bpy.types.Menu.draw_preset
+    draw = Menu.draw_preset
 
 
 class CLIP_MT_track_color_specials(Menu):
index 625c3b1ab2f7fba323afaa7872f7bac4a036bd24..409494b5cbb3ee58a9183387d0dc2a415d5d3e3a 100644 (file)
 # <pep8 compliant>
 import bpy
 from bpy.types import Header, Menu, Panel
+from .properties_paint_common import UnifiedPaintPanel
+
+class ImagePaintPanel(UnifiedPaintPanel):
+    bl_space_type = 'IMAGE_EDITOR'
+    bl_region_type = 'UI'
 
 
 class BrushButtonsPanel():
@@ -641,7 +646,7 @@ class IMAGE_PT_view_properties(Panel):
             sub.row().prop(uvedit, "draw_stretch_type", expand=True)
 
 
-class IMAGE_PT_paint(Panel):
+class IMAGE_PT_paint(Panel, ImagePaintPanel):
     bl_space_type = 'IMAGE_EDITOR'
     bl_region_type = 'UI'
     bl_label = "Paint"
@@ -666,13 +671,13 @@ class IMAGE_PT_paint(Panel):
             col.prop(brush, "color", text="")
 
             row = col.row(align=True)
-            row.prop(brush, "size", slider=True)
-            row.prop(brush, "use_pressure_size", toggle=True, text="")
+            self.prop_unified_size(row, context, brush, "size", slider=True)
+            self.prop_unified_size(row, context, brush, "use_pressure_size")
 
             row = col.row(align=True)
-            row.prop(brush, "strength", slider=True)
-            row.prop(brush, "use_pressure_strength", toggle=True, text="")
-
+            self.prop_unified_strength(row, context, brush, "strength", slider=True)
+            self.prop_unified_strength(row, context, brush, "use_pressure_strength")
+            
             row = col.row(align=True)
             row.prop(brush, "jitter", slider=True)
             row.prop(brush, "use_pressure_jitter", toggle=True, text="")
@@ -763,7 +768,7 @@ class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel):
         row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
 
 
-class IMAGE_UV_sculpt_curve(bpy.types.Panel):
+class IMAGE_UV_sculpt_curve(Panel):
     bl_space_type = 'IMAGE_EDITOR'
     bl_region_type = 'UI'
     bl_label = "UV Sculpt Curve"
@@ -793,7 +798,7 @@ class IMAGE_UV_sculpt_curve(bpy.types.Panel):
         row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
 
 
-class IMAGE_UV_sculpt(bpy.types.Panel):
+class IMAGE_UV_sculpt(Panel, ImagePaintPanel):
     bl_space_type = 'IMAGE_EDITOR'
     bl_region_type = 'UI'
     bl_label = "UV Sculpt"
@@ -815,13 +820,13 @@ class IMAGE_UV_sculpt(bpy.types.Panel):
             col = layout.column()
 
             row = col.row(align=True)
-            row.prop(brush, "size", slider=True)
-            row.prop(brush, "use_pressure_size", toggle=True, text="")
+            self.prop_unified_size(row, context, brush, "size", slider=True)
+            self.prop_unified_size(row, context, brush, "use_pressure_size")
 
             row = col.row(align=True)
-            row.prop(brush, "strength", slider=True)
-            row.prop(brush, "use_pressure_strength", toggle=True, text="")
-
+            self.prop_unified_strength(row, context, brush, "strength", slider=True)
+            self.prop_unified_strength(row, context, brush, "use_pressure_strength")
+            
         split = layout.split()
         col = split.column()
 
index 95af67b9d3ac74519448147fb5fd1c6a7fdf7ac3..bbc04dad816f52003541082c58393c28172e4b0c 100644 (file)
@@ -19,6 +19,7 @@
 # <pep8 compliant>
 import bpy
 from bpy.types import Menu, Panel
+from .properties_paint_common import UnifiedPaintPanel
 
 
 class View3DPanel():
@@ -447,48 +448,12 @@ class VIEW3D_PT_tools_posemode_options(View3DPanel, Panel):
 # ********** default tools for paint modes ****************
 
 
-class PaintPanel():
+class View3DPaintPanel(UnifiedPaintPanel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'TOOLS'
 
-    @staticmethod
-    def paint_settings(context):
-        toolsettings = context.tool_settings
-
-        if context.sculpt_object:
-            return toolsettings.sculpt
-        elif context.vertex_paint_object:
-            return toolsettings.vertex_paint
-        elif context.weight_paint_object:
-            return toolsettings.weight_paint
-        elif context.image_paint_object:
-            return toolsettings.image_paint
-        elif context.particle_edit_object:
-            return toolsettings.particle_edit
-
-        return None
-
-    @staticmethod
-    def unified_paint_settings(parent, context):
-        ups = context.tool_settings.unified_paint_settings
-        parent.label(text="Unified Settings:")
-        parent.prop(ups, "use_unified_size", text="Size")
-        parent.prop(ups, "use_unified_strength", text="Strength")
-
-    @staticmethod
-    def prop_unified_size(parent, context, brush, prop_name, icon='NONE', text="", slider=False):
-        ups = context.tool_settings.unified_paint_settings
-        ptr = ups if ups.use_unified_size else brush
-        parent.prop(ptr, prop_name, icon=icon, text=text, slider=slider)
-
-    @staticmethod
-    def prop_unified_strength(parent, context, brush, prop_name, icon='NONE', text="", slider=False):
-        ups = context.tool_settings.unified_paint_settings
-        ptr = ups if ups.use_unified_strength else brush
-        parent.prop(ptr, prop_name, icon=icon, text=text, slider=slider)
-
 
-class VIEW3D_PT_tools_brush(PaintPanel, Panel):
+class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
     bl_label = "Brush"
 
     @classmethod
@@ -715,7 +680,7 @@ class VIEW3D_PT_tools_brush(PaintPanel, Panel):
             #row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
 
-class VIEW3D_PT_tools_brush_texture(PaintPanel, Panel):
+class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
     bl_label = "Texture"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -794,7 +759,7 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, Panel):
             sub.prop(brush, "texture_overlay_alpha", text="Alpha")
 
 
-class VIEW3D_PT_tools_brush_tool(PaintPanel, Panel):
+class VIEW3D_PT_tools_brush_tool(Panel, View3DPaintPanel):
     bl_label = "Tool"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -828,7 +793,7 @@ class VIEW3D_PT_tools_brush_tool(PaintPanel, Panel):
         row.prop(brush, "use_paint_image", text="", icon='TPAINT_HLT')
 
 
-class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel):
+class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
     bl_label = "Stroke"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -920,7 +885,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel, Panel):
             #    row.prop(brush, "use_pressure_spacing", toggle=True, text="")
 
 
-class VIEW3D_PT_tools_brush_curve(PaintPanel, Panel):
+class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
     bl_label = "Curve"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -947,7 +912,7 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel, Panel):
         row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
 
 
-class VIEW3D_PT_sculpt_options(PaintPanel, Panel):
+class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
     bl_label = "Options"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -975,7 +940,7 @@ class VIEW3D_PT_sculpt_options(PaintPanel, Panel):
         self.unified_paint_settings(layout, context)
 
 
-class VIEW3D_PT_sculpt_symmetry(PaintPanel, Panel):
+class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
     bl_label = "Symmetry"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -999,7 +964,7 @@ class VIEW3D_PT_sculpt_symmetry(PaintPanel, Panel):
         layout.prop(sculpt, "use_symmetry_feather", text="Feather")
 
 
-class VIEW3D_PT_tools_brush_appearance(PaintPanel, Panel):
+class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
     bl_label = "Appearance"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -1061,7 +1026,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
         col.operator("object.vertex_group_fix", text="Fix Deforms")
 
 
-class VIEW3D_PT_tools_weightpaint_options(PaintPanel, Panel):
+class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
     bl_context = "weightpaint"
     bl_label = "Options"
 
@@ -1097,7 +1062,7 @@ class VIEW3D_PT_tools_weightpaint_options(PaintPanel, Panel):
 # ********** default tools for vertex-paint ****************
 
 
-class VIEW3D_PT_tools_vertexpaint(PaintPanel, Panel):
+class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
     bl_context = "vertexpaint"
     bl_label = "Options"
 
@@ -1191,7 +1156,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
         col.operator("image.save_dirty", text="Save All Edited")
 
 
-class VIEW3D_PT_imagepaint_options(PaintPanel):
+class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
     bl_label = "Options"
     bl_options = {'DEFAULT_CLOSED'}
 
index 40d439169a32d569a09f66a8e599939eb324649d..1fe385dbf81c3a962c642a039694560bd5ecb864 100644 (file)
@@ -225,7 +225,7 @@ int txt_extended_ascii_as_utf8(char **str)
        int length = strlen(*str);
 
        while ((*str)[i]) {
-               if((bad_char= BLI_utf8_invalid_byte(*str+i, length)) == -1)
+               if((bad_char= BLI_utf8_invalid_byte(*str+i, length-i)) == -1)
                        break;
 
                added++;
@@ -238,7 +238,7 @@ int txt_extended_ascii_as_utf8(char **str)
                i= 0;
                
                while ((*str)[i]) {
-                       if((bad_char= BLI_utf8_invalid_byte((*str)+i, length)) == -1) {
+                       if((bad_char= BLI_utf8_invalid_byte((*str)+i, length-i)) == -1) {
                                memcpy(newstr+mi, (*str)+i, length - i + 1);
                                break;
                        }
index d623697921cb60e8b557d9b6e252eb08f4e70b50..203fd00538f399b02af805df30eeb4057ae2156a 100644 (file)
@@ -653,7 +653,7 @@ static char *code_generate_vertex(ListBase *nodes)
 
 int GPU_bicubic_bump_support(void)
 {
-       return GLEW_ARB_texture_gather && GLEW_ARB_texture_query_lod && GLEW_VERSION_3_0;
+       return GLEW_ARB_texture_query_lod && GLEW_VERSION_3_0;
 }
 
 void GPU_code_generate_glsl_lib(void)
@@ -669,7 +669,6 @@ void GPU_code_generate_glsl_lib(void)
        if(GPU_bicubic_bump_support()){
                BLI_dynstr_append(ds, "/* These are needed for high quality bump mapping */\n"
                                "#version 130\n"
-                               "#extension GL_ARB_texture_gather: enable\n"
                                "#extension GL_ARB_texture_query_lod: enable\n"
                                "#define BUMP_BICUBIC\n");
        }