Merging r57816 through r57896 from trunk into soc-2013-depsgraph_mt
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 1 Jul 2013 09:07:21 +0000 (09:07 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 1 Jul 2013 09:07:21 +0000 (09:07 +0000)
94 files changed:
build_files/build_environment/install_deps.sh
intern/cycles/blender/blender_curves.cpp
intern/cycles/kernel/closure/bsdf_diffuse_ramp.h
intern/cycles/kernel/closure/bsdf_phong_ramp.h
intern/cycles/kernel/osl/osl_services.cpp
intern/cycles/kernel/osl/osl_services.h
intern/cycles/kernel/osl/osl_shader.cpp
intern/cycles/render/background.cpp
intern/cycles/render/background.h
intern/cycles/render/osl.cpp
intern/cycles/render/scene.h
intern/cycles/render/shader.cpp
intern/cycles/util/util_math.h
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/locale/boost_locale_wrapper.cpp
release/datafiles/startup.blend
release/scripts/startup/bl_operators/node.py
release/scripts/startup/bl_ui/properties_data_mesh.py
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
release/text/readme.html
source/blender/blenfont/SConscript
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_dir.c
source/blender/blenfont/intern/blf_font.c
source/blender/blenfont/intern/blf_glyph.c
source/blender/blenfont/intern/blf_internal_types.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_mball.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/image_gen.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenlib/intern/path_util.c
source/blender/blenloader/intern/readfile.c
source/blender/bmesh/intern/bmesh_operators.c
source/blender/bmesh/operators/bmo_bridge.c
source/blender/compositor/nodes/COM_MixNode.cpp
source/blender/compositor/operations/COM_MixBaseOperation.cpp
source/blender/compositor/operations/COM_MixBaseOperation.h
source/blender/editors/animation/fmodifier_ui.c
source/blender/editors/armature/armature_relations.c
source/blender/editors/armature/armature_skinning.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/include/ED_mesh.h
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/mesh/mesh_navmesh.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_clip/clip_buttons.c
source/blender/editors/space_clip/clip_dopesheet_draw.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_script/script_edit.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/transform/transform_conversions.c
source/blender/gpu/intern/gpu_draw.c
source/blender/ikplugin/intern/ikplugin_api.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_wm.c
source/blender/nodes/composite/nodes/node_composite_colorcorrection.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/shadeoutput.c
source/blender/windowmanager/intern/wm_cursors.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_operators.c
source/creator/creator.c
source/tests/bl_run_operators.py

index 7b41f156ea8b604cf8e7425f2ebb17165179c154..0444f9d288a3b229b58014221e8334e806f808d7 100755 (executable)
@@ -1142,6 +1142,9 @@ EOF
   fi
 
   _with_built_openexr=true
+
+  # Just always run it, much simpler this way!
+  _need_openexr_ldconfig=true
 }
 
 #### Build OIIO ####
@@ -3135,6 +3138,9 @@ fi
 if [ $_need_oiio_ldconfig == true ]; then
   sudo sh -c "echo \"$INST/oiio/lib\" > /etc/ld.so.conf.d/oiio.conf"
 fi
+if [ $_need_openexr_ldconfig == true ]; then
+  sudo sh -c "echo \"$INST/openexr/lib\" > /etc/ld.so.conf.d/openexr.conf"
+fi
 sudo /sbin/ldconfig  # XXX OpenSuse does not include sbin in command path with sudo!!!
 INFO ""
 
index 56d78fb5c269f4fba2d725709a33f6356d7378fb..27c52797f5fb64caa0e65d608a2d78b4b4112f92 100644 (file)
@@ -183,7 +183,7 @@ 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 = background ? b_psys.settings().render_step() : b_psys.settings().draw_step();
-                               int ren_step = (int)pow((float)2.0f,(float)draw_step);
+                               int ren_step = (int)powf(2.0f, (float)draw_step);
                                int totparts = b_psys.particles.length();
                                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;
index 579145bdd80b4568df8b1dfdc0186dc848f62720..2e43e16693f51ad49f5aee716e87978f4b7336ea 100644 (file)
@@ -41,6 +41,8 @@ __device float3 bsdf_diffuse_ramp_get_color(const ShaderClosure *sc, const float
        
        float npos = pos * (float)(MAXCOLORS - 1);
        int ipos = float_to_int(npos);
+       if (ipos < 0)
+               return colors[0];
        if (ipos >= (MAXCOLORS - 1))
                return colors[MAXCOLORS - 1];
        float offset = npos - (float)ipos;
index b51d41486c7f89451d3ecd72ebf7fe6db4e9cdaa..1e332933287655b164e14d4593d1e1a5429e15b0 100644 (file)
@@ -41,6 +41,8 @@ __device float3 bsdf_phong_ramp_get_color(const ShaderClosure *sc, const float3
        
        float npos = pos * (float)(MAXCOLORS - 1);
        int ipos = float_to_int(npos);
+       if (ipos < 0)
+               return colors[0];
        if (ipos >= (MAXCOLORS - 1))
                return colors[MAXCOLORS - 1];
        float offset = npos - (float)ipos;
@@ -49,6 +51,8 @@ __device float3 bsdf_phong_ramp_get_color(const ShaderClosure *sc, const float3
 
 __device int bsdf_phong_ramp_setup(ShaderClosure *sc)
 {
+       sc->data0 = max(sc->data0, 0.0f);
+       
        sc->type = CLOSURE_BSDF_PHONG_RAMP_ID;
        return SD_BSDF | SD_BSDF_HAS_EVAL | SD_BSDF_GLOSSY;
 }
index fd3f349286b1abae2217e581439fd84922346f38..e1e43b117e71e623e7e28a30f85cfb9dbd04c6a0 100644 (file)
@@ -104,9 +104,10 @@ OSLRenderServices::~OSLRenderServices()
 {
 }
 
-void OSLRenderServices::thread_init(KernelGlobals *kernel_globals_)
+void OSLRenderServices::thread_init(KernelGlobals *kernel_globals_, OSL::TextureSystem *osl_ts_)
 {
        kernel_globals = kernel_globals_;
+       osl_ts = osl_ts_;
 }
 
 bool OSLRenderServices::get_matrix(OSL::Matrix44 &result, OSL::TransformationPtr xform, float time)
@@ -767,7 +768,7 @@ bool OSLRenderServices::texture(ustring filename, TextureOpt &options,
                                 float s, float t, float dsdx, float dtdx,
                                 float dsdy, float dtdy, float *result)
 {
-       OSL::TextureSystem *ts = kernel_globals->osl->ts;
+       OSL::TextureSystem *ts = osl_ts;
        bool status = ts->texture(filename, options, s, t, dsdx, dtdx, dsdy, dtdy, result);
 
        if(!status) {
@@ -789,7 +790,7 @@ bool OSLRenderServices::texture3d(ustring filename, TextureOpt &options,
                                   const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy,
                                   const OSL::Vec3 &dPdz, float *result)
 {
-       OSL::TextureSystem *ts = kernel_globals->osl->ts;
+       OSL::TextureSystem *ts = osl_ts;
        bool status = ts->texture3d(filename, options, P, dPdx, dPdy, dPdz, result);
 
        if(!status) {
@@ -811,7 +812,7 @@ bool OSLRenderServices::environment(ustring filename, TextureOpt &options,
                                     OSL::ShaderGlobals *sg, const OSL::Vec3 &R,
                                     const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy, float *result)
 {
-       OSL::TextureSystem *ts = kernel_globals->osl->ts;
+       OSL::TextureSystem *ts = osl_ts;
        bool status = ts->environment(filename, options, R, dRdx, dRdy, result);
 
        if(!status) {
@@ -832,7 +833,7 @@ bool OSLRenderServices::get_texture_info(ustring filename, int subimage,
                                          ustring dataname,
                                          TypeDesc datatype, void *data)
 {
-       OSL::TextureSystem *ts = kernel_globals->osl->ts;
+       OSL::TextureSystem *ts = osl_ts;
        return ts->get_texture_info(filename, subimage, dataname, datatype, data);
 }
 
index 5043852846d8ba29beff0129f97f3ed3a390b1c4..ca18c85a1671c742876acb9b27410e328afed4e2 100644 (file)
@@ -45,7 +45,7 @@ public:
        OSLRenderServices();
        ~OSLRenderServices();
        
-       void thread_init(KernelGlobals *kernel_globals);
+       void thread_init(KernelGlobals *kernel_globals, OSL::TextureSystem *ts);
 
        bool get_matrix(OSL::Matrix44 &result, OSL::TransformationPtr xform, float time);
        bool get_inverse_matrix(OSL::Matrix44 &result, OSL::TransformationPtr xform, float time);
@@ -148,6 +148,7 @@ public:
 
 private:
        KernelGlobals *kernel_globals;
+       OSL::TextureSystem *osl_ts;
 };
 
 CCL_NAMESPACE_END
index ddde199663acbdf718d739c8e0e734674b02f729..0b0c8ab2e3c351755da18558b4d8e7f78e8a2f23 100644 (file)
@@ -47,7 +47,7 @@ void OSLShader::thread_init(KernelGlobals *kg, KernelGlobals *kernel_globals, OS
 
        /* per thread kernel data init*/
        kg->osl = osl_globals;
-       kg->osl->services->thread_init(kernel_globals);
+       kg->osl->services->thread_init(kernel_globals, osl_globals->ts);
 
        OSL::ShadingSystem *ss = kg->osl->ss;
        OSLThreadData *tdata = new OSLThreadData();
index 3513665f256010fd77fde42d8b696b3956db6482..2b2a8609c1a08a4886b20509cf65915dc29c083b 100644 (file)
@@ -38,6 +38,7 @@ Background::Background()
        use = true;
 
        visibility = ~0;
+       shader = 0;
 
        transparent = false;
        need_update = true;
@@ -54,6 +55,11 @@ void Background::device_update(Device *device, DeviceScene *dscene, Scene *scene
        
        device_free(device, dscene);
 
+       if(use)
+               shader = scene->default_background;
+       else
+               shader = scene->default_empty;
+
        /* set shader index and transparent option */
        KernelBackground *kbackground = &dscene->data.background;
 
@@ -61,10 +67,7 @@ void Background::device_update(Device *device, DeviceScene *dscene, Scene *scene
        kbackground->ao_distance = ao_distance;
 
        kbackground->transparent = transparent;
-       if(use)
-               kbackground->shader = scene->shader_manager->get_shader_id(scene->default_background);
-       else
-               kbackground->shader = scene->shader_manager->get_shader_id(scene->default_empty);
+       kbackground->shader = scene->shader_manager->get_shader_id(shader);
 
        if(!(visibility & PATH_RAY_DIFFUSE))
                kbackground->shader |= SHADER_EXCLUDE_DIFFUSE;
index e0c0c42de37149334a2245d90b6dc3a2672eb12b..ffedfbe3da3352fcd47553eddc4d88b3e29e4a16 100644 (file)
@@ -35,6 +35,7 @@ public:
        bool use;
 
        uint visibility;
+       uint shader;
 
        bool transparent;
        bool need_update;
index 56bb95821726b1358ef2418b8bd0cfa573370a8d..3f269f44abe4f19278c1b8c0d320aae932485b0e 100644 (file)
@@ -122,6 +122,12 @@ void OSLShaderManager::device_update(Device *device, DeviceScene *dscene, Scene
        scene->image_manager->set_osl_texture_system((void*)ts);
 
        device_update_common(device, dscene, scene, progress);
+
+       /* greedyjit test
+       {
+               thread_scoped_lock lock(ss_shared_mutex);
+               ss->optimize_all_groups();
+       }*/
 }
 
 void OSLShaderManager::device_free(Device *device, DeviceScene *dscene, Scene *scene)
@@ -187,6 +193,7 @@ void OSLShaderManager::shading_system_init()
                ss_shared->attribute("lockgeom", 1);
                ss_shared->attribute("commonspace", "world");
                ss_shared->attribute("searchpath:shader", path_get("shader"));
+               //ss_shared->attribute("greedyjit", 1);
 
                /* our own ray types */
                static const char *raytypes[] = {
@@ -714,7 +721,7 @@ void OSLCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType ty
 
        current_type = type;
 
-       ss->ShaderGroupBegin();
+       ss->ShaderGroupBegin(shader->name.c_str());
 
        ShaderNode *output = graph->output();
        set<ShaderNode*> dependencies;
@@ -777,9 +784,11 @@ void OSLCompiler::compile(OSLGlobals *og, Shader *shader)
                        if(shader->graph_bump) {
                                ss->clear_state();
                                compile_type(shader, shader->graph_bump, SHADER_TYPE_SURFACE);
+                               shader->osl_surface_bump_ref = ss->state();
                        }
+                       else
+                               shader->osl_surface_bump_ref = shader->osl_surface_ref;
 
-                       shader->osl_surface_bump_ref = ss->state();
                        ss->clear_state();
 
                        shader->has_surface = true;
index 545a765cc22be94d9097115a1c7075374f413c6f..0790d4159c5a12a9e60033342833aa048917bece 100644 (file)
@@ -180,7 +180,6 @@ public:
        int default_surface;
        int default_light;
        int default_background;
-       int default_holdout;
        int default_empty;
 
        /* device */
index da6c3566f6990dca8cc6814a438cfa69b5bf3640..21b43380f2cf951496b6ac451ff3f36aa7dea1c8 100644 (file)
@@ -16,6 +16,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
+#include "background.h"
 #include "bssrdf.h"
 #include "device.h"
 #include "graph.h"
@@ -191,10 +192,10 @@ void ShaderManager::device_update_shaders_used(Scene *scene)
        foreach(Shader *shader, scene->shaders)
                shader->used = false;
 
+       scene->shaders[scene->background->shader]->used = true;
        scene->shaders[scene->default_surface]->used = true;
        scene->shaders[scene->default_light]->used = true;
        scene->shaders[scene->default_background]->used = true;
-       scene->shaders[scene->default_holdout]->used = true;
        scene->shaders[scene->default_empty]->used = true;
 
        foreach(Mesh *mesh, scene->meshes)
@@ -327,22 +328,6 @@ void ShaderManager::add_default(Scene *scene)
                scene->default_background = scene->shaders.size() - 1;
        }
 
-       /* default holdout */
-       {
-               graph = new ShaderGraph();
-
-               closure = graph->add(new HoldoutNode());
-               out = graph->output();
-
-               graph->connect(closure->output("Holdout"), out->input("Surface"));
-
-               shader = new Shader();
-               shader->name = "default_holdout";
-               shader->graph = graph;
-               scene->shaders.push_back(shader);
-               scene->default_holdout = scene->shaders.size() - 1;
-       }
-
        /* default empty */
        {
                graph = new ShaderGraph();
index 05ed8a2d3f6f65baf9c6c53d597cb0b8aa7b7c69..14ebf311a4b3a2e89070de75f161ee3930bc03c2 100644 (file)
@@ -1166,7 +1166,7 @@ __device float safe_powf(float a, float b)
                return 1.0f;
        if(a == 0.0f)
                return 0.0f;
-       if(a < 0.0f && b != (int)b)
+       if(a < 0.0f && b != float_to_int(b))
                return 0.0f;
        
        return compatible_powf(a, b);
index 607b6ae77b2bb6670443b22b60759144ac96bed0..01a760609ff90a813550e78414829dcb2a3a1145 100644 (file)
@@ -549,7 +549,7 @@ int cocoa_request_qtcodec_settings(bContext *C, wmOperator *op)
 
 #pragma mark initialization/finalization
 
-const char *user_locale; // Global current user locale
+char GHOST_user_locale[128]; // Global current user locale
 
 GHOST_SystemCocoa::GHOST_SystemCocoa()
 {
@@ -590,11 +590,13 @@ GHOST_SystemCocoa::GHOST_SystemCocoa()
        m_ignoreWindowSizedMessages = false;
        
        //Get current locale
+       NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
        CFLocaleRef myCFLocale = CFLocaleCopyCurrent();
        NSLocale * myNSLocale = (NSLocale *) myCFLocale;
        [myNSLocale autorelease];
        NSString *nsIdentifier = [myNSLocale localeIdentifier];
-       user_locale = [nsIdentifier UTF8String];        
+       strncpy(GHOST_user_locale, [nsIdentifier UTF8String], sizeof(GHOST_user_locale) - 1);
+       [pool drain];
 }
 
 GHOST_SystemCocoa::~GHOST_SystemCocoa()
index 6d3b34b078519ab3dab57eab956505f6e7777668..b0d0b1a5b5dbed78e68a17d5cef4cf38eea4e437 100644 (file)
@@ -106,6 +106,11 @@ static int is_crappy_intel_card(void)
        return is_crappy;
 }
 
+/* force NVidia Optimus to used dedicated graphics */
+extern "C" {
+       __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
+}
+
 GHOST_WindowWin32::GHOST_WindowWin32(
     GHOST_SystemWin32 *system,
     const STR_String& title,
index 3492ec05e82f6abda27f3b545ee5407474509577..5d7ba5994676846ef3d7ea2aa1341628d70c4774 100644 (file)
@@ -65,8 +65,8 @@ void bl_locale_set(const char *locale)
                }
                else {
 #ifdef __APPLE__
-                       extern const char *user_locale; // pulled from Ghost_SystemCocoa
-                       std::string locale_osx = user_locale + std::string(".UTF-8");
+                       extern char GHOST_user_locale[128]; // pulled from Ghost_SystemCocoa
+                       std::string locale_osx = GHOST_user_locale + std::string(".UTF-8");
                        _locale = gen(locale_osx.c_str());
 #else
                        _locale = gen("");
index 805308cf6629f2517aa45ab14d2676d204bc4a0d..8b58493fe3a4a1b8e404ee214d1610104aabbab8 100644 (file)
Binary files a/release/datafiles/startup.blend and b/release/datafiles/startup.blend differ
index 1e92619c519b6a3f67a197d3044d420c6fa94258..cc1fa93ec2c660ca3856e7e866ea20d8e40e4d27 100644 (file)
@@ -66,12 +66,8 @@ class NodeAddOperator():
 
         # convert mouse position to the View2D for later node placement
         if context.region.type == 'WINDOW':
-            # XXX, why use DPI for coords?
-            dpi_fac = context.user_preferences.system.dpi / 72.0
             space.cursor_location = v2d.region_to_view(event.mouse_region_x,
                                                        event.mouse_region_y)
-            space.cursor_location /= dpi_fac
-
         else:
             space.cursor_location = tree.view_center
 
index 04aa59c3b115aa9c796c6c521ffc17c8951b55d0..655fd4045eea553a104f3f7829fcca7447280a87 100644 (file)
@@ -34,6 +34,7 @@ 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_mirror", text="Mirror Vertex Group (Topology)", icon='ARROW_LEFTRIGHT').use_topology = True
         layout.operator("object.vertex_group_remove_from", icon='X', text="Remove from All Groups").use_all_groups = True
         layout.operator("object.vertex_group_remove_from", icon='X', text="Clear Active Group").use_all_verts = True
         layout.operator("object.vertex_group_remove", icon='X', text="Delete All Groups").all = True
@@ -53,6 +54,7 @@ class MESH_MT_shape_key_specials(Menu):
         layout.operator("object.shape_key_transfer", icon='COPY_ID')  # icon is not ideal
         layout.operator("object.join_shapes", icon='COPY_ID')  # icon is not ideal
         layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT')
+        layout.operator("object.shape_key_mirror", text="Mirror Shape Key (Topology)", icon='ARROW_LEFTRIGHT').use_topology = True
         layout.operator("object.shape_key_add", icon='ZOOMIN', text="New Shape From Mix").from_mix = True
         layout.operator("object.shape_key_remove", icon='X', text="Delete All Shapes").all = True
 
index 5d476c01b082bb1a744fa6d8806d11a707beaef2..6701e700e14cabacc5a47046edc3b4137b7d2eda 100644 (file)
@@ -392,7 +392,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-267"
+        layout.operator("wm.url_open", text="Release Log", icon='URL').url = "http://www.blender.org/development/release-logs/blender-268"
         layout.separator()
 
         layout.operator("wm.url_open", text="Blender Website", icon='URL').url = "http://www.blender.org"
index 7bc6d476a4be184b62956101611c7fa4bfbcddc0..444002a07025067ee73975666fb1edb301cb16f8 100644 (file)
@@ -726,8 +726,6 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
 
         # Weight Paint Mode #
         elif context.weight_paint_object and brush:
-            layout.prop(toolsettings, "use_auto_normalize", text="Auto Normalize")
-            layout.prop(toolsettings, "use_multipaint", text="Multi-Paint")
 
             col = layout.column()
 
@@ -746,6 +744,10 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
 
             col.prop(brush, "vertex_tool", text="Blend")
 
+            col = layout.column()
+            col.prop(toolsettings, "use_auto_normalize", text="Auto Normalize")
+            col.prop(toolsettings, "use_multipaint", text="Multi-Paint")
+
         # Vertex Paint Mode #
         elif context.vertex_paint_object and brush:
             col = layout.column()
@@ -1151,7 +1153,9 @@ class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
         if obj.type == 'MESH':
             mesh = obj.data
             col.prop(mesh, "use_mirror_x")
-            col.prop(mesh, "use_mirror_topology")
+            row = col.row()
+            row.active = mesh.use_mirror_x
+            row.prop(mesh, "use_mirror_topology")
 
         col.prop(wpaint, "input_samples")
 
index f45ec47030a5131584e4c031961d6f930faae869..35057220c95fccb2ff514d79ea7c98db7eb355e2 100644 (file)
   </style>
 </head>
 <body>
-<p class="title"><b>Blender 2.67</b></p>
+<p class="title"><b>Blender 2.68</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.67</b></p>
-<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.67. This release is the eight 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-267/">More information about this release</a>.</p>
+<p class="header"><b>2.68</b></p>
+<p class="body">The Blender Foundation and online developer community is proud to present Blender 2.68. This release is the ninth 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-268/">More information about this release</a>.</p>
 <p><br></p>
 <p class="header"><b>Bugs</b></p>
-<p class="body">Although Blender 2.67 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.68 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-267/">www.blender.org/development/release-logs/blender-267/</a><br>
+       Full release log                        <a href="http://www.blender.org/development/release-logs/blender-268/">www.blender.org/development/release-logs/blender-268/</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>
index 3973fed677f5a54c3d980d43142614094bb698d4..1c573fa4a5971922c31e4da362c496502e6ead37 100644 (file)
@@ -55,4 +55,7 @@ if sys.platform == 'win32' or env['OURPLATFORM'] == 'linuxcross':
 if env['WITH_BF_INTERNATIONAL']:
     defs.append('WITH_INTERNATIONAL')
 
+if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
+    incs.append(env['BF_PTHREADS_INC'])
+
 env.BlenderLib('bf_blenfont', sources, incs, defines=defs, libtype=['core', 'player'], priority=[210, 210])
index 6523aa87473f5321fc32ea02aa3cae3852050961..130eaaecba57479be290b0c4b44367663526c8f7 100644 (file)
@@ -44,6 +44,7 @@
 #include "DNA_vec_types.h"
 
 #include "BLI_math.h"
+#include "BLI_threads.h"
 
 #include "BIF_gl.h"
 #include "BLF_api.h"
index 116a55c057951db2a76a209364523e390603b3e6..721e86fbf2195ff6e732313be87570408d134528 100644 (file)
@@ -46,6 +46,7 @@
 #include "BLI_listbase.h"
 #include "BLI_path_util.h"
 #include "BLI_string.h"
+#include "BLI_threads.h"
 
 #include "BIF_gl.h"
 
index f346478889b404ded66909d7bf005f69fad6cc7f..56a77d643d61e2f11e23f74d9ea4153b0451fe23 100644 (file)
@@ -48,6 +48,7 @@
 #include "BLI_rect.h"
 #include "BLI_string.h"
 #include "BLI_string_utf8.h"
+#include "BLI_threads.h"
 #include "BLI_linklist.h"  /* linknode */
 
 #include "BIF_gl.h"
 
 /* freetype2 handle ONLY for this file!. */
 static FT_Library ft_lib;
+static SpinLock ft_lib_mutex;
 
 int blf_font_init(void)
 {
+       BLI_spin_init(&ft_lib_mutex);
        return FT_Init_FreeType(&ft_lib);
 }
 
 void blf_font_exit(void)
 {
        FT_Done_FreeType(ft_lib);
+       BLI_spin_end(&ft_lib_mutex);
 }
 
 void blf_font_size(FontBLF *font, unsigned int size, unsigned int dpi)
@@ -572,6 +576,7 @@ static void blf_font_fill(FontBLF *font)
        font->buf_info.col[3] = 0;
 
        font->ft_lib = ft_lib;
+       font->ft_lib_mutex = &ft_lib_mutex;
 }
 
 FontBLF *blf_font_new(const char *name, const char *filename)
index 4812f8f23f766febdc752940f6d6dd48357e40f7..55424145b43455f827f043fd3bdb37cc3d04569f 100644 (file)
@@ -48,6 +48,7 @@
 
 #include "BLI_listbase.h"
 #include "BLI_rect.h"
+#include "BLI_threads.h"
 
 #include "BIF_gl.h"
 #include "BLF_api.h"
@@ -224,6 +225,19 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
        if (g)
                return g;
 
+       /* glyphs are dynamically created as needed by font rendering. this means that
+        * to make font rendering thread safe we have to do locking here. note that this
+        * must be a lock for the whole library and not just per font, because the font
+        * renderer uses a shared buffer internally */
+       BLI_spin_lock(font->ft_lib_mutex);
+
+       /* search again after locking */
+       g = blf_glyph_search(font->glyph_cache, c);
+       if (g) {
+               BLI_spin_unlock(font->ft_lib_mutex);
+               return g;
+       }
+
        if (font->flags & BLF_HINTING)
                flags &= ~FT_LOAD_NO_HINTING;
        
@@ -231,8 +245,11 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
                err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO);
        else
                err = FT_Load_Glyph(font->face, (FT_UInt)index, flags);  
-       if (err)
+
+       if (err) {
+               BLI_spin_unlock(font->ft_lib_mutex);
                return NULL;
+       }
 
        /* get the glyph. */
        slot = font->face->glyph;
@@ -251,8 +268,10 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
                err = FT_Render_Glyph(slot, FT_RENDER_MODE_NORMAL);
        }
 
-       if (err || slot->format != FT_GLYPH_FORMAT_BITMAP)
+       if (err || slot->format != FT_GLYPH_FORMAT_BITMAP) {
+               BLI_spin_unlock(font->ft_lib_mutex);
                return NULL;
+       }
 
        g = (GlyphBLF *)MEM_callocN(sizeof(GlyphBLF), "blf_glyph_add");
        g->c = c;
@@ -289,6 +308,9 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
 
        key = blf_hash(g->c);
        BLI_addhead(&(font->glyph_cache->bucket[key]), g);
+
+       BLI_spin_unlock(font->ft_lib_mutex);
+
        return g;
 }
 
index 36294bfe3b5efa259648e1f0cded0b737e3ac344..096ff50a3ca67f5c83b5cf2ad7a2b4b0eb024f28 100644 (file)
@@ -217,6 +217,9 @@ typedef struct FontBLF {
        /* freetype2 lib handle. */
        FT_Library ft_lib;
 
+       /* Mutex lock for library */
+       SpinLock *ft_lib_mutex;
+
        /* freetype2 face. */
        FT_Face face;
 
index dfab15a6f12ff75df8f61d7bdb13f0db9713b572..9e874c9aa151f1e2137341d14f8f3fa7295533b0 100644 (file)
@@ -52,7 +52,7 @@ extern "C" {
 /* can be left blank, otherwise a,b,c... etc with no quotes */
 #define BLENDER_VERSION_CHAR    b
 /* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE   alpha
+#define BLENDER_VERSION_CYCLE   rc
 
 extern char versionstr[]; /* from blender.c */
 
index 9a9b8a4da4db523ad6c42a190fda51eb32bad107..7665e1b54dc6df497daf6cb9ff84889f9f329a38 100644 (file)
@@ -57,9 +57,11 @@ float *BKE_mball_make_orco(struct Object *ob, struct ListBase *dispbase);
 
 void BKE_mball_properties_copy(struct Scene *scene, struct Object *active_object);
 
-int BKE_mball_minmax(struct MetaBall *mb, float min[3], float max[3]);
-int BKE_mball_center_median(struct MetaBall *mb, float r_cent[3]);
-int BKE_mball_center_bounds(struct MetaBall *mb, float r_cent[3]);
+bool BKE_mball_minmax(struct MetaBall *mb, float min[3], float max[3]);
+bool BKE_mball_minmax_ex(struct MetaBall *mb, float min[3], float max[3],
+                         float obmat[4][4], const short flag);
+bool BKE_mball_center_median(struct MetaBall *mb, float r_cent[3]);
+bool BKE_mball_center_bounds(struct MetaBall *mb, float r_cent[3]);
 void BKE_mball_translate(struct MetaBall *mb, const float offset[3]);
 
 struct MetaElem *BKE_mball_element_add(struct MetaBall *mb, const int type);
index 7481a403dc882c1589a5dd8b742dd6a855dc2384..de1f3deaf811c68a03505d17996f3afe3500250a 100644 (file)
@@ -146,7 +146,7 @@ void BKE_mesh_flush_hidden_from_verts(struct Mesh *me);
 
 void BKE_mesh_flush_hidden_from_polys_ex(struct MVert *mvert,
                                          const struct MLoop *mloop,
-                                         struct MEdge *medge, int totedge,
+                                         struct MEdge *medge, const int totedge,
                                          const struct MPoly *mpoly, const int totpoly);
 void BKE_mesh_flush_hidden_from_polys(struct Mesh *me);
 
index d1bf42183c10edb62a83df02cf77d7fa4ce969d0..b2ba1755303b4d216e2b867934fa5f4b86aba2cd 100644 (file)
@@ -1947,9 +1947,9 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
                                      DerivedMesh **final_r,
                                      CustomDataMask dataMask)
 {
-       ModifierData *md;
+       ModifierData *md, *previewmd = NULL;
        float (*deformedVerts)[3] = NULL;
-       CustomDataMask mask;
+       CustomDataMask mask, previewmask = 0;
        DerivedMesh *dm, *orcodm = NULL;
        int i, numVerts = 0, cageIndex = modifiers_getCageIndex(scene, ob, NULL, 1);
        CDMaskLink *datamasks, *curr;
@@ -1963,6 +1963,7 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
        const int do_final_wmcol = FALSE;
        int do_init_wmcol = ((((Mesh *)ob->data)->drawflag & ME_DRAWEIGHT) && !do_final_wmcol);
        int do_init_statvis = ((((Mesh *)ob->data)->drawflag & ME_DRAW_STATVIS) && !do_init_wmcol);
+       const int do_mod_wmcol = do_init_wmcol;
 
        modifiers_clearErrors(ob);
 
@@ -1973,7 +1974,18 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
        dm = NULL;
        md = modifiers_getVirtualModifierList(ob);
 
-       datamasks = modifiers_calcDataMasks(scene, ob, md, dataMask, required_mode, NULL, 0);
+       /* copied from mesh_calc_modifiers */
+       if (do_mod_wmcol) {
+               previewmd = modifiers_getLastPreview(scene, md, required_mode);
+               /* even if the modifier doesn't need the data, to make a preview it may */
+               if (previewmd) {
+                       if (do_mod_wmcol) {
+                               previewmask = CD_MASK_MDEFORMVERT;
+                       }
+               }
+       }
+
+       datamasks = modifiers_calcDataMasks(scene, ob, md, dataMask, required_mode, previewmd, previewmask);
 
        curr = datamasks;
        for (i = 0; md; i++, md = md->next, curr = curr->next) {
index c2912a39b6585f26c2a2ce401d1b3e62cb336e3a..d10d6b23ba4a0eb45bef01b3b8650f7258cc5e80 100644 (file)
@@ -1455,9 +1455,8 @@ static void lib_id_recalc_data_tag(Main *bmain, ID *id)
 }
 
 /* node was checked to have lasttime != curtime and is if type ID_OB */
-static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
+static void flush_update_node(Main *bmain, DagNode *node, unsigned int layer, int curtime)
 {
-       Main *bmain = G.main;
        DagAdjList *itA;
        Object *ob, *obc;
        int oldflag, changed = 0;
@@ -1541,7 +1540,7 @@ static void flush_update_node(DagNode *node, unsigned int layer, int curtime)
        /* we only go deeper if node not checked or something changed  */
        for (itA = node->child; itA; itA = itA->next) {
                if (changed || itA->node->lasttime != curtime)
-                       flush_update_node(itA->node, layer, curtime);
+                       flush_update_node(bmain, itA->node, layer, curtime);
        }
        
 }
@@ -1571,9 +1570,8 @@ static unsigned int flush_layer_node(Scene *sce, DagNode *node, int curtime)
 }
 
 /* node was checked to have lasttime != curtime, and is of type ID_OB */
-static void flush_pointcache_reset(Scene *scene, DagNode *node, int curtime, int reset)
+static void flush_pointcache_reset(Main *bmain, Scene *scene, DagNode *node, int curtime, int reset)
 {
-       Main *bmain = G.main;
        DagAdjList *itA;
        Object *ob;
        
@@ -1590,10 +1588,10 @@ static void flush_pointcache_reset(Scene *scene, DagNode *node, int curtime, int
                                                lib_id_recalc_data_tag(bmain, &ob->id);
                                        }
 
-                                       flush_pointcache_reset(scene, itA->node, curtime, 1);
+                                       flush_pointcache_reset(bmain, scene, itA->node, curtime, 1);
                                }
                                else
-                                       flush_pointcache_reset(scene, itA->node, curtime, 0);
+                                       flush_pointcache_reset(bmain, scene, itA->node, curtime, 0);
                        }
                }
        }
@@ -1694,7 +1692,7 @@ void DAG_scene_flush_update(Main *bmain, Scene *sce, unsigned int lay, const sho
        lasttime = sce->theDag->time;
        for (itA = firstnode->child; itA; itA = itA->next)
                if (itA->node->lasttime != lasttime && itA->node->type == ID_OB)
-                       flush_update_node(itA->node, lay, lasttime);
+                       flush_update_node(bmain, itA->node, lay, lasttime);
 
        /* if update is not due to time change, do pointcache clears */
        if (!time) {
@@ -1710,10 +1708,10 @@ void DAG_scene_flush_update(Main *bmain, Scene *sce, unsigned int lay, const sho
                                                lib_id_recalc_data_tag(bmain, &ob->id);
                                        }
 
-                                       flush_pointcache_reset(sce, itA->node, lasttime, 1);
+                                       flush_pointcache_reset(bmain, sce, itA->node, lasttime, 1);
                                }
                                else
-                                       flush_pointcache_reset(sce, itA->node, lasttime, 0);
+                                       flush_pointcache_reset(bmain, sce, itA->node, lasttime, 0);
                        }
                }
        }
@@ -1797,7 +1795,7 @@ static short animdata_use_time(AnimData *adt)
        return 0;
 }
 
-static void dag_object_time_update_flags(Scene *scene, Object *ob)
+static void dag_object_time_update_flags(Main *bmain, Scene *scene, Object *ob)
 {
        if (ob->constraints.first) {
                bConstraint *con;
@@ -1923,9 +1921,9 @@ static void dag_object_time_update_flags(Scene *scene, Object *ob)
        }
 
        if (ob->recalc & OB_RECALC_OB)
-               lib_id_recalc_tag(G.main, &ob->id);
+               lib_id_recalc_tag(bmain, &ob->id);
        if (ob->recalc & OB_RECALC_DATA)
-               lib_id_recalc_data_tag(G.main, &ob->id);
+               lib_id_recalc_data_tag(bmain, &ob->id);
 
 }
 /* flag all objects that need recalc, for changes in time for example */
@@ -1949,7 +1947,7 @@ void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const s
                        /* 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);
+                       dag_object_time_update_flags(bmain, sce_iter, ob);
                }
 
                /* handled in next loop */
@@ -1962,7 +1960,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(scene, go->ob);
+                                       dag_object_time_update_flags(bmain, scene, go->ob);
                                }
                        }
                }
@@ -1981,7 +1979,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, scene->camera);
+                       dag_object_time_update_flags(bmain, scene, scene->camera);
        }
 
        /* and store the info in groupobject */
@@ -2129,9 +2127,8 @@ static void dag_id_flush_update__isDependentTexture(void *userData, Object *UNUS
        }
 }
 
-static void dag_id_flush_update(Scene *sce, ID *id)
+static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id)
 {
-       Main *bmain = G.main;
        Object *obt, *ob = NULL;
        short idtype;
 
@@ -2279,7 +2276,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
                        MovieClip *clip = BKE_object_movieclip_get(sce, sce->camera, 1);
 
                        if (clip)
-                               dag_id_flush_update(sce, &clip->id);
+                               dag_id_flush_update(bmain, sce, &clip->id);
                }
 
                /* update editors */
@@ -2314,7 +2311,7 @@ void DAG_ids_flush_tagged(Main *bmain)
                                if (id->flag & (LIB_ID_RECALC | LIB_ID_RECALC_DATA)) {
                                        
                                        for (dsl = listbase.first; dsl; dsl = dsl->next)
-                                               dag_id_flush_update(dsl->scene, id);
+                                               dag_id_flush_update(bmain, dsl->scene, id);
                                        
                                        do_flush = TRUE;
                                }
index c31ec593e5413165f2264e790bc732f739bb6455..eda22a095ef353e965e850b43f73a83f91007c6a 100644 (file)
@@ -287,7 +287,7 @@ static void checker_board_text(unsigned char *rect, float *rect_float, int width
        int x, y;
        int pen_x, pen_y;
        char text[3] = {'A', '1', '\0'};
-       const int mono = blf_mono_font;
+       const int mono = blf_mono_font_render;
 
        BLF_size(mono, 54, 72); /* hard coded size! */
 
index 2336844667534025e1e68598024dffab15f41d61..c9b904e76ac3bb47e7704bc64020e61826d71512 100644 (file)
 int BKE_lattice_index_from_uvw(struct Lattice *lt,
                                const int u, const int v, const int w)
 {
-       return (w * (lt->pntsu * lt->pntsv) + (v * lt->pntsu) + u);
+       const int totu = lt->pntsu;
+       const int totv = lt->pntsv;
+
+       return (w * (totu * totv) + (v * totu) + u);
 }
 
 void BKE_lattice_index_to_uvw(struct Lattice *lt, const int index,
                               int *r_u, int *r_v, int *r_w)
 {
-       *r_u = (index % lt->pntsu);
-       *r_v = (index / lt->pntsu) % lt->pntsv;
-       *r_w = (index / (lt->pntsu * lt->pntsv));
+       const int totu = lt->pntsu;
+       const int totv = lt->pntsv;
+
+       *r_u = (index % totu);
+       *r_v = (index / totu) % totv;
+       *r_w = (index / (totu * totv));
 }
 
 void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du)
index c1715ada7bdb5ea611ee39b2b0c3f7d13f93242f..5b5d4f3c318917e82f27aca3f98a778cf96e9a5d 100644 (file)
@@ -1573,7 +1573,7 @@ void BKE_library_make_local(Main *bmain, Library *lib, bool untagged_only)
                        {
                                if (lib == NULL || id->lib == lib) {
                                        if (id->lib) {
-                                               id_clear_lib_data(bmain, id); /* sets 'id->flag' */
+                                               id_make_local(id, false);
 
                                                /* why sort alphabetically here but not in
                                                 * id_clear_lib_data() ? - campbell */
index afe1c0f24df952828e5d9fcff41a61dc44fc6842..f84a6088ee53e875f8a4568931fbc3547dcdf7b7 100644 (file)
@@ -2375,8 +2375,44 @@ void BKE_mball_polygonize(Scene *scene, Object *ob, ListBase *dispbase, bool for
        freepolygonize(&process);
 }
 
+bool BKE_mball_minmax_ex(MetaBall *mb, float min[3], float max[3],
+                         float obmat[4][4], const short flag)
+{
+       const float scale = obmat ? mat4_to_scale(obmat) : 1.0f;
+       MetaElem *ml;
+       bool change = false;
+       float centroid[3], vec[3];
+
+       INIT_MINMAX(min, max);
+
+       for (ml = mb->elems.first; ml; ml = ml->next) {
+               if ((ml->flag & flag) == flag) {
+                       const float scale_mb = (ml->rad * 0.5f) * scale;
+                       int i;
+
+                       if (obmat) {
+                               mul_v3_m4v3(centroid, obmat, &ml->x);
+                       }
+                       else {
+                               copy_v3_v3(centroid, &ml->x);
+                       }
+
+                       /* TODO, non circle shapes cubes etc, probably nobody notices - campbell */
+                       for (i = -1; i != 3; i += 2) {
+                               copy_v3_v3(vec, centroid);
+                               add_v3_fl(vec, scale_mb * i);
+                               minmax_v3v3_v3(min, max, vec);
+                       }
+                       change = true;
+               }
+       }
+
+       return change;
+}
+
+
 /* basic vertex data functions */
-int BKE_mball_minmax(MetaBall *mb, float min[3], float max[3])
+bool BKE_mball_minmax(MetaBall *mb, float min[3], float max[3])
 {
        MetaElem *ml;
 
@@ -2389,7 +2425,7 @@ int BKE_mball_minmax(MetaBall *mb, float min[3], float max[3])
        return (mb->elems.first != NULL);
 }
 
-int BKE_mball_center_median(MetaBall *mb, float r_cent[3])
+bool BKE_mball_center_median(MetaBall *mb, float r_cent[3])
 {
        MetaElem *ml;
        int total = 0;
@@ -2407,7 +2443,7 @@ int BKE_mball_center_median(MetaBall *mb, float r_cent[3])
        return (total != 0);
 }
 
-int BKE_mball_center_bounds(MetaBall *mb, float r_cent[3])
+bool BKE_mball_center_bounds(MetaBall *mb, float r_cent[3])
 {
        float min[3], max[3];
 
index 92ba82a9ce2c0c81a664e9659636261be3eef3da..4ec86cbac7b3c1e13dce64501c379f91809cbd42 100644 (file)
@@ -517,9 +517,9 @@ Mesh *BKE_mesh_copy_ex(Main *bmain, Mesh *me)
                }
        }
 
-       men->mselect = NULL;
        men->edit_btmesh = NULL;
 
+       men->mselect = MEM_dupallocN(men->mselect);
        men->bb = MEM_dupallocN(men->bb);
        
        men->key = BKE_key_copy(me->key);
index e556e6f23c359bafe7c71fc9e116fd2abd809856..bb160cff86a281ab1e8ce839a6a85f52ecc5743b 100644 (file)
@@ -923,7 +923,7 @@ Object *BKE_object_add(Main *bmain, Scene *scene, int type)
        base = BKE_scene_base_add(scene, ob);
        BKE_scene_base_deselect_all(scene);
        BKE_scene_base_select(scene, base);
-       DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
+       DAG_id_tag_update_ex(bmain, &ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
 
        return ob;
 }
@@ -2313,7 +2313,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
        BoundBox bb;
        float vec[3];
        int a;
-       short change = FALSE;
+       bool change = false;
        
        switch (ob->type) {
                case OB_CURVE:
@@ -2390,6 +2390,17 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
                        }
                }
                break;
+               case OB_MBALL:
+               {
+                       float ob_min[3], ob_max[3];
+
+                       change = BKE_mball_minmax_ex(ob->data, ob_min, ob_max, ob->obmat, 0);
+                       if (change) {
+                               minmax_v3v3_v3(min_r, max_r, ob_min);
+                               minmax_v3v3_v3(min_r, max_r, ob_max);
+                       }
+                       break;
+               }
        }
 
        if (change == FALSE) {
index c073c716ec699f87c49e5817774840b2f6ccd3e9..8141fc8aaa189e6bc35ee117be66b864538d3039 100644 (file)
@@ -2901,7 +2901,7 @@ typedef struct ReconstructProgressData {
        int message_size;
 } ReconstructProgressData;
 
-/* Create mew libmv Tracks structure from blender's tracks list. */
+/* Create new libmv Tracks structure from blender's tracks list. */
 static struct libmv_Tracks *libmv_tracks_new(ListBase *tracksbase, int width, int height)
 {
        int tracknr = 0;
index fe50c2abcc19577df502cb23123a518b8af19b81..1e76a7f316439e80d7c5efd45a40e0bb55134df9 100644 (file)
@@ -530,6 +530,7 @@ void BLI_path_rel(char *file, const char *relfile)
                 * This is replaced by the two slashes at the beginning */
                char *p = temp;
                char *q = file;
+               char *r = res;
 
 #ifdef WIN32
                while (tolower(*p) == tolower(*q))
@@ -557,20 +558,23 @@ void BLI_path_rel(char *file, const char *relfile)
                        while ( (p >= temp) && (*p != '/') ) { --p; --q; }
                }
                
-               strcpy(res, "//");
+               r += BLI_strcpy_rlen(r, "//");
 
                /* p now points to the slash that is at the beginning of the part
                 * where the path is different from the relative path. 
                 * We count the number of directories we need to go up in the
                 * hierarchy to arrive at the common 'prefix' of the path
                 */
+               if (p < temp) p = temp;
                while (p && p < lslash) {
-                       if (*p == '/') 
-                               strcat(res, "../");
+                       if (*p == '/') {
+                               r += BLI_strcpy_rlen(r, "../");
+                       }
                        p++;
                }
 
-               strcat(res, q + 1); /* don't copy the slash at the beginning */
+               /* don't copy the slash at the beginning */
+               r += BLI_strcpy_rlen(r, q + 1);
                
 #ifdef  WIN32
                BLI_char_switch(res + 2, '/', '\\');
index 917b1e5d054eff0749418c863421ad1f99978f5f..9fa352a581768cea38de2209901c430afc5fd9f8 100644 (file)
@@ -4148,6 +4148,11 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
        mesh->bb = NULL;
        mesh->edit_btmesh = NULL;
        
+       /* happens with old files */
+       if (mesh->mselect == NULL) {
+               mesh->totselect = 0;
+       }
+
        /* Multires data */
        mesh->mr= newdataadr(fd, mesh->mr);
        if (mesh->mr) {
index 1d20f94c51ccd7110c07612c212a73b0d6225807..3ffdbe167d726498edb78ddc6ea8833481e69a19 100644 (file)
@@ -1371,6 +1371,12 @@ void *BMO_iter_new(BMOIter *iter,
                        return NULL;
                }
        }
+       else if (iter->slot->slot_type == BMO_OP_SLOT_ELEMENT_BUF) {
+               BLI_assert(restrictmask & slot->slot_subtype.elem);
+       }
+       else {
+               BLI_assert(0);
+       }
 
        return BMO_iter_step(iter);
 }
index a517b7af5021844810c63f4b1d5a97d5c96e88cd..045997fb6be08da755faaff1c0866781fa79b31e 100644 (file)
@@ -371,6 +371,14 @@ static void bridge_loop_pair(BMesh *bm,
                BMO_op_initf(bm, &op_sub, 0,
                             "triangulate faces=%hf",
                             BM_ELEM_TAG, true);
+               /* calc normals for input faces before executing */
+               {
+                       BMOIter siter;
+                       BMFace *f;
+                       BMO_ITER (f, &siter, op_sub.slots_in, "faces", BM_FACE) {
+                               BM_face_normal_update(f);
+                       }
+               }
                BMO_op_exec(bm, &op_sub);
                BMO_slot_buffer_flag_enable(bm, op_sub.slots_out, "faces.out", BM_FACE, FACE_OUT);
                BMO_slot_buffer_hflag_enable(bm, op_sub.slots_out, "faces.out", BM_FACE, BM_ELEM_TAG, false);
index 3e8f1fb0f744f485935cda69e8def9cdc0977bba..ab4e464327d32bb08877ac4cd7bc0309d5cff172 100644 (file)
@@ -124,16 +124,6 @@ void MixNode::convertToOperations(ExecutionSystem *graph, CompositorContext *con
        convertProg->setUseValueAlphaMultiply(useAlphaPremultiply);
        convertProg->setUseClamp(useClamp);
 
-       if (color1Socket->isConnected()) {
-               convertProg->setResolutionInputSocketIndex(1);
-       }
-       else {
-               if (color2Socket->isConnected())
-                       convertProg->setResolutionInputSocketIndex(2);
-               else
-                       convertProg->setResolutionInputSocketIndex(0);
-       }
-
        valueSocket->relinkConnections(convertProg->getInputSocket(0), 0, graph);
        color1Socket->relinkConnections(convertProg->getInputSocket(1), 1, graph);
        color2Socket->relinkConnections(convertProg->getInputSocket(2), 2, graph);
index 438fb84ebb79f775a529be51433ab5d0497e0d44..5b455338bb0e8cb427d69f7660806cf9030f1238 100644 (file)
@@ -63,6 +63,30 @@ void MixBaseOperation::executePixel(float output[4], float x, float y, PixelSamp
        output[3] = inputColor1[3];
 }
 
+void MixBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
+{
+       InputSocket *socket;
+       unsigned int tempPreferredResolution[2] = {0, 0};
+       unsigned int tempResolution[2];
+
+       socket = this->getInputSocket(1);
+       socket->determineResolution(tempResolution, tempPreferredResolution);
+       if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
+               this->setResolutionInputSocketIndex(1);
+       }
+       else {
+               socket = this->getInputSocket(2);
+               socket->determineResolution(tempResolution, tempPreferredResolution);
+               if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
+                       this->setResolutionInputSocketIndex(2);
+               }
+               else {
+                       this->setResolutionInputSocketIndex(0);
+               }
+       }
+       NodeOperation::determineResolution(resolution, preferredResolution);
+}
+
 void MixBaseOperation::deinitExecution()
 {
        this->m_inputValueOperation = NULL;
index 75ca1c3f6c662b187e5d72df2c2dc9de6828c1fa..3c0c0778190fe485b89b0dcc3b0293147bba422b 100644 (file)
@@ -70,6 +70,9 @@ public:
         * Deinitialize the execution
         */
        void deinitExecution();
+
+       void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
+
        
        void setUseValueAlphaMultiply(const bool value) { this->m_valueAlphaMultiply = value; }
        bool useValueAlphaMultiply() { return this->m_valueAlphaMultiply; }
index a1cb931030a5fef4cc6121344c22e36298954767..adea3bcdc314e25db609422fa678dc8aaefc8aaf 100644 (file)
@@ -111,7 +111,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
        uiBlock *block;
        uiBut *but;
        PointerRNA ptr;
-       short bwidth = width - 30; /* max button width */
+       short bwidth = width - 1.5 * UI_UNIT_X; /* max button width */
        
        /* init the RNA-pointer */
        RNA_pointer_create(id, &RNA_FModifierFunctionGenerator, fcm, &ptr);
@@ -138,7 +138,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
                        /* draw polynomial order selector */
                        row = uiLayoutRow(layout, FALSE);
                        block = uiLayoutGetBlock(row);
-                       but = uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 10, 0, bwidth, 20,
+                       but = uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 0.5f * UI_UNIT_X, 0, bwidth, UI_UNIT_Y,
                                        &data->poly_order, 1, 100, 0, 0,
                                        TIP_("'Order' of the Polynomial (for a polynomial with n terms, 'order' is n-1)"));
                        uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
@@ -147,11 +147,11 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
                        /* calculate maximum width of label for "x^n" labels */
                        if (data->arraysize > 2) {
                                BLI_snprintf(xval, sizeof(xval), "x^%u", data->arraysize);
-                               maxXWidth = UI_GetStringWidth(xval) + 10; /* XXX: UI_GetStringWidth is not accurate */
+                               maxXWidth = UI_GetStringWidth(xval) + 0.5 * UI_UNIT_X; /* XXX: UI_GetStringWidth is not accurate */
                        }
                        else {
                                /* basic size (just "x") */
-                               maxXWidth = UI_GetStringWidth("x") + 10; 
+                               maxXWidth = UI_GetStringWidth("x") + 0.5 * UI_UNIT_X;
                        }
                        
                        /* draw controls for each coefficient and a + sign at end of row */
@@ -162,12 +162,12 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
                        for (i = 0; (i < data->arraysize) && (cp); i++, cp++) {
                                /* To align with first line... */
                                if (i)
-                                       uiDefBut(block, LABEL, 1, "   ", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
+                                       uiDefBut(block, LABEL, 1, "   ", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                                else
-                                       uiDefBut(block, LABEL, 1, "y =", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
+                                       uiDefBut(block, LABEL, 1, "y =", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                                
                                /* coefficient */
-                               uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, bwidth / 2, 20, cp, -UI_FLT_MAX, UI_FLT_MAX,
+                               uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, bwidth / 2, UI_UNIT_Y, cp, -UI_FLT_MAX, UI_FLT_MAX,
                                          10, 3, TIP_("Coefficient for polynomial"));
                                
                                /* 'x' param (and '+' if necessary) */
@@ -177,10 +177,10 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
                                        BLI_strncpy(xval, "x", sizeof(xval));
                                else
                                        BLI_snprintf(xval, sizeof(xval), "x^%u", i);
-                               uiDefBut(block, LABEL, 1, xval, 0, 0, maxXWidth, 20, NULL, 0.0, 0.0, 0, 0, TIP_("Power of x"));
+                               uiDefBut(block, LABEL, 1, xval, 0, 0, maxXWidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, TIP_("Power of x"));
                                
                                if ( (i != (data->arraysize - 1)) || ((i == 0) && data->arraysize == 2) ) {
-                                       uiDefBut(block, LABEL, 1, "+", 0, 0, 20, 20, NULL, 0.0, 0.0, 0, 0, "");
+                                       uiDefBut(block, LABEL, 1, "+", 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                                        
                                        /* next coefficient on a new row */
                                        row = uiLayoutRow(layout, TRUE);
@@ -188,7 +188,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
                                }
                                else {
                                        /* For alignment in UI! */
-                                       uiDefBut(block, LABEL, 1, " ", 0, 0, 20, 20, NULL, 0.0, 0.0, 0, 0, "");
+                                       uiDefBut(block, LABEL, 1, " ", 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                                }
                        }
                        break;
@@ -202,7 +202,7 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
                        /* draw polynomial order selector */
                        row = uiLayoutRow(layout, FALSE);
                        block = uiLayoutGetBlock(row);
-                       but = uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 0, 0, width - 30, 19,
+                       but = uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 0, 0, width - 1.5 * UI_UNIT_X, UI_UNIT_Y,
                                        &data->poly_order, 1, 100, 0, 0,
                                        TIP_("'Order' of the Polynomial (for a polynomial with n terms, 'order' is n-1)"));
                        uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
@@ -216,31 +216,31 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
                        for (i = 0; (i < data->poly_order) && (cp); i++, cp += 2) {
                                /* To align with first line */
                                if (i)
-                                       uiDefBut(block, LABEL, 1, "   ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
+                                       uiDefBut(block, LABEL, 1, "   ", 0, 0, 2.5 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                                else
-                                       uiDefBut(block, LABEL, 1, "y =", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
+                                       uiDefBut(block, LABEL, 1, "y =", 0, 0, 2.5 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                                /* opening bracket */
-                               uiDefBut(block, LABEL, 1, "(", 0, 0, 20, 20, NULL, 0.0, 0.0, 0, 0, "");
+                               uiDefBut(block, LABEL, 1, "(", 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                                
                                /* coefficients */
-                               uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX,
+                               uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 5 * UI_UNIT_X, UI_UNIT_Y, cp, -UI_FLT_MAX, UI_FLT_MAX,
                                          10, 3, TIP_("Coefficient of x"));
                                
-                               uiDefBut(block, LABEL, 1, "x +", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
+                               uiDefBut(block, LABEL, 1, "x +", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                                
-                               uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp + 1, -UI_FLT_MAX, UI_FLT_MAX,
+                               uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 5 * UI_UNIT_X, UI_UNIT_Y, cp + 1, -UI_FLT_MAX, UI_FLT_MAX,
                                          10, 3, TIP_("Second coefficient"));
                                
                                /* closing bracket and multiplication sign */
                                if ( (i != (data->poly_order - 1)) || ((i == 0) && data->poly_order == 2) ) {
-                                       uiDefBut(block, LABEL, 1, ") \xc3\x97", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
+                                       uiDefBut(block, LABEL, 1, ") \xc3\x97", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                                        
                                        /* set up new row for the next pair of coefficients */
                                        row = uiLayoutRow(layout, TRUE);
                                        block = uiLayoutGetBlock(row);
                                }
                                else 
-                                       uiDefBut(block, LABEL, 1, ")  ", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
+                                       uiDefBut(block, LABEL, 1, ")  ", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                        }
                }
                break;
@@ -438,9 +438,9 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
        row = uiLayoutRow(layout, FALSE);
        block = uiLayoutGetBlock(row);
                
-       uiDefBut(block, LABEL, 1, IFACE_("Control Points:"), 0, 0, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
+       uiDefBut(block, LABEL, 1, IFACE_("Control Points:"), 0, 0, 7.5 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                
-       but = uiDefBut(block, BUT, B_FMODIFIER_REDRAW, IFACE_("Add Point"), 0, 0, 150, 19,
+       but = uiDefBut(block, BUT, B_FMODIFIER_REDRAW, IFACE_("Add Point"), 0, 0, 7.5 * UI_UNIT_X, UI_UNIT_Y,
                       NULL, 0, 0, 0, 0, TIP_("Add a new control-point to the envelope on the current frame"));
        uiButSetFunc(but, fmod_envelope_addpoint_cb, env, NULL);
                
@@ -451,16 +451,16 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
                block = uiLayoutGetBlock(row);
                
                uiBlockBeginAlign(block);
-               but = uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Fra:"), 0, 0, 90, 20,
+               but = uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Fra:"), 0, 0, 4.5 * UI_UNIT_X, UI_UNIT_Y,
                                &fed->time, -MAXFRAMEF, MAXFRAMEF, 10, 1, TIP_("Frame that envelope point occurs"));
                uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
                        
-               uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Min:"), 0, 0, 100, 20,
+               uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Min:"), 0, 0, 5 * UI_UNIT_X, UI_UNIT_Y,
                          &fed->min, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, TIP_("Minimum bound of envelope at this point"));
-               uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Max:"), 0, 0, 100, 20,
+               uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Max:"), 0, 0, 5 * UI_UNIT_X, UI_UNIT_Y,
                          &fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, TIP_("Maximum bound of envelope at this point"));
 
-               but = uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 18, 20,
+               but = uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 0.9 * UI_UNIT_X, UI_UNIT_Y,
                                   NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete envelope control point"));
                uiButSetFunc(but, fmod_envelope_deletepoint_cb, env, SET_INT_IN_POINTER(i));
                uiBlockBeginAlign(block);
index 7ed7ebbb4b93da2bebd4e2b46e43825735bd7aac..d5dbe80538ff6fae3767b8f1d825e4ab676e1734 100644 (file)
@@ -468,8 +468,8 @@ static int separate_armature_exec(bContext *C, wmOperator *UNUSED(op))
        /* TODO: use context iterators for this? */
        CTX_DATA_BEGIN(C, Base *, base, visible_bases)
        {
-               if (base->object == obedit) base->flag |= 1;
-               else base->flag &= ~1;
+               if (base->object == obedit) base->flag |= SELECT;
+               else base->flag &= ~SELECT;
        }
        CTX_DATA_END;
        
index 2e43c388fa871ddd7a622514d0d59b73dc61c1a2..0a9cff3dc90c37d2d165070b0b8cf4bd9ef06172 100644 (file)
@@ -199,10 +199,11 @@ static void envelope_bone_weighting(Object *ob, Mesh *mesh, float (*verts)[3], i
        bDeformGroup *dgroup;
        float distance;
        int i, iflip, j;
+       bool use_topology = (mesh->editflag & ME_EDIT_MIRROR_TOPO) != 0;
 
        /* for each vertex in the mesh */
        for (i = 0; i < mesh->totvert; i++) {
-               iflip = (dgroupflip) ? mesh_get_x_mirror_vert(ob, i) : 0;
+               iflip = (dgroupflip) ? mesh_get_x_mirror_vert(ob, i, use_topology) : 0;
                
                /* for each skinnable bone */
                for (j = 0; j < numbones; ++j) {
index 25a7eedfb8ce25f0c10e4adcdd9cbd8d97e3f7bc..01825f2c2f9c4525ce4a9d83fed499f84b4d71c5 100644 (file)
@@ -652,6 +652,7 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
        float solution, weight;
        int *vertsflipped = NULL, *mask = NULL;
        int a, tottri, j, bbone, firstsegment, lastsegment;
+       bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
 
        MVert *mvert = me->mvert;
        int use_vert_sel = FALSE;
@@ -716,7 +717,7 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
        if (dgroupflip) {
                vertsflipped = MEM_callocN(sizeof(int) * me->totvert, "vertsflipped");
                for (a = 0; a < me->totvert; a++)
-                       vertsflipped[a] = mesh_get_x_mirror_vert(ob, a);
+                       vertsflipped[a] = mesh_get_x_mirror_vert(ob, a, use_topology);
        }
        
        /* compute weights per bone */
index 3e0269aa13818749d6ee6237e376afa5c767d2d0..3929969c5c4947f73dabc406ae2fe8bd9ac4c203 100644 (file)
@@ -77,9 +77,9 @@ struct MeshStatVis;
 /* editmesh_utils.c */
 void           EDBM_verts_mirror_cache_begin_ex(struct BMEditMesh *em, const int axis,
                                                 const bool use_self, const bool use_select,
-                                                const bool is_topo, float maxdist, int *r_index);
+                                                const bool use_topology, float maxdist, int *r_index);
 void           EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const int axis,
-                                             const bool use_self, const bool use_select);
+                                             const bool use_self, const bool use_select, const bool use_toplogy);
 void           EDBM_verts_mirror_apply(struct BMEditMesh *em, const int sel_from, const int sel_to);
 struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v);
 void           EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v);
@@ -241,7 +241,8 @@ void                 ED_vgroup_data_clamp_range(struct ID *id, const int total);
 bool                 ED_vgroup_give_array(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot);
 bool                 ED_vgroup_copy_array(struct Object *ob, struct Object *ob_from);
 void                 ED_vgroup_mirror(struct Object *ob,
-                                      const bool mirror_weights, const bool flip_vgroups, const bool all_vgroups,
+                                      const bool mirror_weights, const bool flip_vgroups,
+                                      const bool all_vgroups, const bool use_topology,
                                       int *r_totmirr, int *r_totfail);
 
 bool                 ED_vgroup_object_is_edit_mode(struct Object *ob);
@@ -304,8 +305,10 @@ int         mesh_mirrtopo_table(struct Object *ob, char mode);
 /* retrieves mirrored cache vert, or NULL if there isn't one.
  * note: calling this without ensuring the mirror cache state
  * is bad.*/
-int            mesh_get_x_mirror_vert(struct Object *ob, int index);
-struct BMVert *editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em, struct BMVert *eve, const float co[3], int index);
+int            mesh_get_x_mirror_vert(struct Object *ob, int index, const bool use_topology);
+struct BMVert *editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em,
+                                           struct BMVert *eve, const float co[3],
+                                           int index, const bool use_topology);
 int           *mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em);
 
 bool ED_mesh_pick_vert(struct bContext *C,      struct Object *ob, const int mval[2], unsigned int *index, int size, bool use_zbuf);
index 0f2cedf8b0a5ad747f260cc87e426997d4a73fde..fbe23b1a1ed67811b57f700913ece9c70a35c526 100644 (file)
@@ -1253,8 +1253,11 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
                }
 
                if (rect_i.ymin < 0) {
-                       int newy1;
-                       UI_view2d_to_region_no_clip(&butregion->v2d, 0, but->rect.ymax + ofsy, NULL, &newy1);
+                       int newy1 = but->rect.ymax + ofsy;
+
+                       if (butregion->v2d.cur.xmin != butregion->v2d.cur.xmax)
+                               UI_view2d_to_region_no_clip(&butregion->v2d, 0, newy1, NULL, &newy1);
+
                        newy1 += butregion->winrct.ymin;
 
                        rect_i.ymax = BLI_rcti_size_y(&rect_i) + newy1;
index 3216e79deb01877a6ad49af85d0be2ffce274de9..977f3489dacff72dcbb8106744ba3fe39a014527 100644 (file)
@@ -898,6 +898,7 @@ void ui_theme_init_default(void)
        rgba_char_args_set(btheme->tseq.transition, 162, 95, 111, 255);
        rgba_char_args_set(btheme->tseq.meta,   109, 145, 131, 255);
        rgba_char_args_set(btheme->tseq.preview_back,   0, 0, 0, 255);
+       rgba_char_args_set(btheme->tseq.grid,   64, 64, 64, 255);
 
        /* space image */
        btheme->tima = btheme->tv3d;
index 468bbb8a5c5112f5904d1c37a4ae7a1015c92512..0e71408edcc3a6bc2164fd5f541e89f72f145785 100644 (file)
@@ -59,8 +59,9 @@
 
 #include "BIF_gl.h"
 
-#include "DNA_object_types.h"
+#include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
+#include "DNA_object_types.h"
 
 #include "GPU_extensions.h"
 
 void EDBM_select_mirrored(BMEditMesh *em, bool extend,
                           int *r_totmirr, int *r_totfail)
 {
+       Mesh *me = (Mesh *)em->ob->data;
        BMVert *v1, *v2;
        BMIter iter;
        int totmirr = 0;
        int totfail = 0;
+       bool use_topology = (me && (me->editflag & ME_EDIT_MIRROR_TOPO));
 
        *r_totmirr = *r_totfail = 0;
 
@@ -92,7 +95,7 @@ void EDBM_select_mirrored(BMEditMesh *em, bool extend,
                }
        }
 
-       EDBM_verts_mirror_cache_begin(em, 0, true, true);
+       EDBM_verts_mirror_cache_begin(em, 0, true, true, use_topology);
 
        if (!extend)
                EDBM_flag_disable_all(em, BM_ELEM_SELECT);
index 0d0134af4e52b1edcd6872dda79b53a0e86a7770..2fa6812d1319e07261ee4078e12ac0877e569126 100644 (file)
@@ -1099,11 +1099,13 @@ void MESH_OT_normals_make_consistent(wmOperatorType *ot)
 static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
+       Mesh *me = obedit->data;
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
        ModifierData *md;
        int mirrx = false, mirry = false, mirrz = false;
        int i, repeat;
        float clip_dist = 0.0f;
+       bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
 
        const bool xaxis = RNA_boolean_get(op->ptr, "xaxis");
        const bool yaxis = RNA_boolean_get(op->ptr, "yaxis");
@@ -1111,7 +1113,7 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
 
        /* mirror before smooth */
        if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
-               EDBM_verts_mirror_cache_begin(em, 0, false, true);
+               EDBM_verts_mirror_cache_begin(em, 0, false, true, use_topology);
        }
 
        /* if there is a mirror modifier with clipping, flag the verts that
@@ -1183,6 +1185,8 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
+       Mesh *me = obedit->data;
+       bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
        int usex = true, usey = true, usez = true, preserve_volume = true;
        int i, repeat;
        float lambda_factor;
@@ -1202,7 +1206,7 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op)
 
        /* mirror before smooth */
        if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) {
-               EDBM_verts_mirror_cache_begin(em, 0, false, true);
+               EDBM_verts_mirror_cache_begin(em, 0, false, true, use_topology);
        }
 
        repeat = RNA_int_get(op->ptr, "repeat");
@@ -2735,7 +2739,7 @@ static int edbm_fill_grid_exec(bContext *C, wmOperator *op)
 void MESH_OT_fill_grid(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Fill Grid";
+       ot->name = "Grid Fill";
        ot->description = "Fill grid from two loops";
        ot->idname = "MESH_OT_fill_grid";
 
@@ -4257,7 +4261,7 @@ static int mesh_symmetry_snap_exec(bContext *C, wmOperator *op)
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
        BMesh *bm = em->bm;
        int *index = MEM_mallocN(bm->totvert * sizeof(*index), __func__);
-       const bool is_topo = false;
+       const bool use_topology = false;
 
        const float thresh = RNA_float_get(op->ptr, "threshold");
        const float fac = RNA_float_get(op->ptr, "factor");
@@ -4276,7 +4280,7 @@ static int mesh_symmetry_snap_exec(bContext *C, wmOperator *op)
        BMVert *v;
        int i;
 
-       EDBM_verts_mirror_cache_begin_ex(em, axis, true, true, is_topo, thresh, index);
+       EDBM_verts_mirror_cache_begin_ex(em, axis, true, true, use_topology, thresh, index);
 
        EDBM_index_arrays_ensure(em, BM_VERT);
 
index 560c314405e4a55d2d9b2fce7b79d1c89588195f..834db3f9ad15ad5a726ebf0bc59f37d1e01b658b 100644 (file)
@@ -1151,13 +1151,13 @@ static BMVert *cache_mirr_intptr_as_bmvert(intptr_t *index_lookup, int index)
  * \param em  Editmesh.
  * \param use_self  Allow a vertex to point to its self (middle verts).
  * \param use_select  Restrict to selected verts.
- * \param is_topo  Use topology mirror.
+ * \param use_topology  Use topology mirror.
  * \param maxdist  Distance for close point test.
  * \param r_index  Optional array to write into, as an alternative to a customdata layer (length of total verts).
  */
 void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const int axis, const bool use_self, const bool use_select,
                                       /* extra args */
-                                      const bool is_topo, float maxdist, int *r_index)
+                                      const bool use_topology, float maxdist, int *r_index)
 {
        Mesh *me = (Mesh *)em->ob->data;
        BMesh *bm = em->bm;
@@ -1188,7 +1188,7 @@ void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const int axis, const bool
 
        BM_mesh_elem_index_ensure(bm, BM_VERT);
 
-       if (is_topo) {
+       if (use_topology) {
                ED_mesh_mirrtopo_init(me, -1, &mesh_topo_store, true);
        }
        else {
@@ -1208,7 +1208,7 @@ void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const int axis, const bool
                        BMVert *v_mirr;
                        int *idx = VERT_INTPTR(v, i);
 
-                       if (is_topo) {
+                       if (use_topology) {
                                v_mirr = cache_mirr_intptr_as_bmvert(mesh_topo_store.index_lookup, i);
                        }
                        else {
@@ -1233,7 +1233,7 @@ void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const int axis, const bool
 
 #undef VERT_INTPTR
 
-       if (is_topo) {
+       if (use_topology) {
                ED_mesh_mirrtopo_free(&mesh_topo_store);
        }
        else {
@@ -1242,17 +1242,13 @@ void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const int axis, const bool
 }
 
 void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const int axis,
-                                   const bool use_self, const bool use_select)
+                                   const bool use_self, const bool use_select,
+                                   const bool use_topology)
 {
-       Mesh *me = (Mesh *)em->ob->data;
-       bool is_topo;
-
-       is_topo = (me && (me->editflag & ME_EDIT_MIRROR_TOPO));
-
        EDBM_verts_mirror_cache_begin_ex(em, axis,
                                         use_self, use_select,
                                         /* extra args */
-                                        is_topo, BM_SEARCH_MAXDIST_MIRR, NULL);
+                                        use_topology, BM_SEARCH_MAXDIST_MIRR, NULL);
 }
 
 BMVert *EDBM_verts_mirror_get(BMEditMesh *em, BMVert *v)
index ba9bd8d3f7b5f7b15bc1049d8f37a1a161d4177d..3d8718ef887e0f70143bc225dd5e2ae414e21b60 100644 (file)
@@ -384,7 +384,8 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
                        BM_vert_create(em->bm, co, NULL, 0);
                }
 
-               EDBM_index_arrays_ensure(em, BM_VERT);
+               /* need to rebuild entirely because array size changes */
+               EDBM_index_arrays_init(em, BM_VERT);
 
                /* create faces */
                for (j = 0; j < trinum; j++) {
index b0d337c365f008405f0a12de26115b86ceed03e3..51b5e30bc3fb63baaf377d97f3d28fb2177c3fc8 100644 (file)
@@ -939,9 +939,9 @@ static int mesh_get_x_mirror_vert_topo(Object *ob, int index)
        return mesh_topo_store.index_lookup[index];
 }
 
-int mesh_get_x_mirror_vert(Object *ob, int index)
+int mesh_get_x_mirror_vert(Object *ob, int index, const bool use_topology)
 {
-       if (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_TOPO) {
+       if (use_topology) {
                return mesh_get_x_mirror_vert_topo(ob, index);
        }
        else {
@@ -1001,9 +1001,9 @@ static BMVert *editbmesh_get_x_mirror_vert_topo(Object *ob, struct BMEditMesh *e
        return NULL;
 }      
 
-BMVert *editbmesh_get_x_mirror_vert(Object *ob, struct BMEditMesh *em, BMVert *eve, const float co[3], int index)
+BMVert *editbmesh_get_x_mirror_vert(Object *ob, struct BMEditMesh *em, BMVert *eve, const float co[3], int index, const bool use_topology)
 {
-       if (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_TOPO) {
+       if (use_topology) {
                return editbmesh_get_x_mirror_vert_topo(ob, em, eve, index);
        }
        else {
@@ -1121,6 +1121,7 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em)
        MVert *mv, *mvert = me->mvert;
        MFace mirrormf, *mf, *hashmf, *mface = me->mface;
        GHash *fhash;
+       const bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
        int *mirrorverts, *mirrorfaces;
        int a;
 
@@ -1130,7 +1131,7 @@ int *mesh_get_x_mirror_faces(Object *ob, BMEditMesh *em)
        mesh_octree_table(ob, em, NULL, 's');
 
        for (a = 0, mv = mvert; a < me->totvert; a++, mv++)
-               mirrorverts[a] = mesh_get_x_mirror_vert(ob, a);
+               mirrorverts[a] = mesh_get_x_mirror_vert(ob, a, use_topology);
 
        mesh_octree_table(ob, em, NULL, 'e');
 
index c7aec9f93d49b6c9856e92adc8399a23f420340c..d6f48b4d3503e2b12b9294359f3ed5e5719406b2 100644 (file)
@@ -2038,7 +2038,7 @@ static int duplicate_exec(bContext *C, wmOperator *op)
        clear_id_newpoins();
        clear_sca_new_poins();  /* sensor/contr/act */
 
-       CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases)
+       CTX_DATA_BEGIN (C, Base *, base, selected_bases)
        {
                Base *basen = object_add_duplicate_internal(bmain, scene, base, dupflag);
 
index 04c67b8d3fa495c24bac08edc800654fee246d32..1f0163bc391f1ff45307877940eebe6108831712 100644 (file)
@@ -460,6 +460,7 @@ static int add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *ob
        ModifierData *md = NULL;
        HookModifierData *hmd = NULL;
        float cent[3];
+       float pose_mat[4][4];
        int tot, ok, *indexar;
        char name[MAX_NAME];
        
@@ -494,11 +495,20 @@ static int add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *ob
        hmd->totindex = tot;
        BLI_strncpy(hmd->name, name, sizeof(hmd->name));
        
+       unit_m4(pose_mat);
+
        if (mode == OBJECT_ADDHOOK_SELOB_BONE) {
                bArmature *arm = ob->data;
                BLI_assert(ob->type == OB_ARMATURE);
                if (arm->act_bone) {
+                       bPoseChannel *pchan_act;
+
                        BLI_strncpy(hmd->subtarget, arm->act_bone->name, sizeof(hmd->subtarget));
+
+                       pchan_act = BKE_pose_channel_active(ob);
+                       if (LIKELY(pchan_act)) {
+                               invert_m4_m4(pose_mat, pchan_act->pose_mat);
+                       }
                }
                else {
                        BKE_report(reports, RPT_WARNING, "Armature has no active object bone");
@@ -512,7 +522,7 @@ static int add_hook_object(Main *bmain, Scene *scene, Object *obedit, Object *ob
        
        invert_m4_m4(ob->imat, ob->obmat);
        /* apparently this call goes from right to left... */
-       mul_serie_m4(hmd->parentinv, ob->imat, obedit->obmat, NULL,
+       mul_serie_m4(hmd->parentinv, pose_mat, ob->imat, obedit->obmat,
                     NULL, NULL, NULL, NULL, NULL);
        
        DAG_relations_tag_update(bmain);
index d3537051861a9f44045e7d39616b62075e1f40ce..0e220357d3063ef7113783a69ef64e2ae1324560 100644 (file)
@@ -368,22 +368,6 @@ typedef enum eLattice_FlipAxes {
        LATTICE_FLIP_W = 2
 } eLattice_FlipAxes;
 
-/* Helper macro for accessing item at index (u, v, w) 
- * < lt: (Lattice)
- * < U: (int) u-axis coordinate of point
- * < V: (int) v-axis coordinate of point
- * < W: (int) w-axis coordinate of point
- * < dimU: (int) number of points per row or number of columns (U-Axis)
- * < dimV: (int) number of rows (V-Axis)
- * > returns: (BPoint *) pointer to BPoint at this index
- */
-#define LATTICE_PT(lt, U, V, W, dimU, dimV)       \
-       ( (lt)->def               +                   \
-         ((dimU) * (dimV)) * (W) +                   \
-         (dimU) * (V)            +                   \
-         (U)                                         \
-       )
-       
 /* Flip midpoint value so that relative distances between midpoint and neighbour-pair is maintained
  * ! Assumes that uvw <=> xyz (i.e. axis-aligned index-axes with coordinate-axes)
  * - Helper for lattice_flip_exec()
@@ -394,7 +378,7 @@ static void lattice_flip_point_value(Lattice *lt, int u, int v, int w, float mid
        float diff;
        
        /* just the point in the middle (unpaired) */
-       bp = LATTICE_PT(lt, u, v, w, lt->pntsu, lt->pntsv);
+       bp = &lt->def[BKE_lattice_index_from_uvw(lt, u, v, w)];
        
        /* flip over axis */
        diff = mid - bp->vec[axis];
@@ -432,8 +416,8 @@ static void lattice_swap_point_pairs(Lattice *lt, int u, int v, int w, float mid
        }
        
        /* get points to operate on */
-       bpA = LATTICE_PT(lt, u0, v0, w0, numU, numV);
-       bpB = LATTICE_PT(lt, u1, v1, w1, numU, numV);
+       bpA = &lt->def[BKE_lattice_index_from_uvw(lt, u0, v0, w0)];
+       bpB = &lt->def[BKE_lattice_index_from_uvw(lt, u1, v1, w1)];
        
        /* Swap all coordinates, so that flipped coordinates belong to
         * the indices on the correct side of the lattice.
index 4c652a82765997e96da8d1d03ea0534c6f2f16ef..45773a2803c3428d51967d20f428aa51110c9c66 100644 (file)
@@ -1430,12 +1430,13 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
        Scene *scene = CTX_data_scene(C);
        const int type = RNA_enum_get(op->ptr, "type");
        Object *ob_src;
-       ID *id;
+       ID *obdata_id;
        int a;
 
        /* group */
        LinkNode *ob_groups = NULL;
-       int is_cycle = FALSE;
+       bool is_cycle = false;
+       bool is_lib = false;
 
        ob_src = ED_object_active_context(C);
 
@@ -1450,14 +1451,15 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
 
                if (ob_src != ob_dst) {
                        if (allow_make_links_data(type, ob_src, ob_dst)) {
+                               obdata_id = ob_dst->data;
+
                                switch (type) {
                                        case MAKE_LINKS_OBDATA: /* obdata */
-                                               id = ob_dst->data;
-                                               id->us--;
+                                               obdata_id->us--;
 
-                                               id = ob_src->data;
-                                               id_us_plus(id);
-                                               ob_dst->data = id;
+                                               obdata_id = ob_src->data;
+                                               id_us_plus(obdata_id);
+                                               ob_dst->data = obdata_id;
 
                                                /* if amount of material indices changed: */
                                                test_object_materials(bmain, ob_dst->data);
@@ -1473,6 +1475,10 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
                                                break;
                                        case MAKE_LINKS_ANIMDATA:
                                                BKE_copy_animdata_id((ID *)ob_dst, (ID *)ob_src, FALSE);
+                                               if (obdata_id->lib) {
+                                                       is_lib = true;
+                                                       break;
+                                               }
                                                BKE_copy_animdata_id((ID *)ob_dst->data, (ID *)ob_src->data, FALSE);
                                                break;
                                        case MAKE_LINKS_GROUP:
@@ -1508,6 +1514,11 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
                                                Curve *cu_src = ob_src->data;
                                                Curve *cu_dst = ob_dst->data;
 
+                                               if (obdata_id->lib) {
+                                                       is_lib = true;
+                                                       break;
+                                               }
+
                                                if (cu_dst->vfont) cu_dst->vfont->id.us--;
                                                cu_dst->vfont = cu_src->vfont;
                                                id_us_plus((ID *)cu_dst->vfont);
@@ -1540,6 +1551,10 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
                }
        }
 
+       if (is_lib) {
+               BKE_report(op->reports, RPT_WARNING, "Skipped editing library object data");
+       }
+
        DAG_relations_tag_update(bmain);
        WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C));
        WM_event_add_notifier(C, NC_OBJECT, NULL);
index 8fead6024fbb5895741a7d06aae7ca38887610e3..ea96db514b289d73ba9579f22fbc1f2bf76eaa20 100644 (file)
@@ -168,7 +168,7 @@ static bool ED_object_shape_key_remove(Main *bmain, Object *ob)
 }
 
 static bool object_shape_key_mirror(bContext *C, Object *ob,
-                                    int *r_totmirr, int *r_totfail)
+                                    int *r_totmirr, int *r_totfail, bool use_topology)
 {
        KeyBlock *kb;
        Key *key;
@@ -196,7 +196,7 @@ static bool object_shape_key_mirror(bContext *C, Object *ob,
                        mesh_octree_table(ob, NULL, NULL, 's');
 
                        for (i1 = 0, mv = me->mvert; i1 < me->totvert; i1++, mv++) {
-                               i2 = mesh_get_x_mirror_vert(ob, i1);
+                               i2 = mesh_get_x_mirror_vert(ob, i1, use_topology);
                                if (i2 == i1) {
                                        fp1 = ((float *)kb->data) + i1 * 3;
                                        fp1[0] = -fp1[0];
@@ -440,8 +440,9 @@ static int shape_key_mirror_exec(bContext *C, wmOperator *op)
 {
        Object *ob = ED_object_context(C);
        int totmirr = 0, totfail = 0;
+       bool use_topology = RNA_boolean_get(op->ptr, "use_topology");
 
-       if (!object_shape_key_mirror(C, ob, &totmirr, &totfail))
+       if (!object_shape_key_mirror(C, ob, &totmirr, &totfail, use_topology))
                return OPERATOR_CANCELLED;
 
        ED_mesh_report_mirror(op, totmirr, totfail);
@@ -462,6 +463,10 @@ void OBJECT_OT_shape_key_mirror(wmOperatorType *ot)
 
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+       /* properties */
+       RNA_def_boolean(ot->srna, "use_topology", 0, "Topology Mirror",
+                       "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
 }
 
 
index b85c7126fdb7f5780badb7bba6c12c7539cb9d8a..e1a18158c2d39459a76ac54ad0a2ff32d826d715 100644 (file)
@@ -438,8 +438,9 @@ static void ED_mesh_defvert_mirror_update_em(Object *ob, BMVert *eve, int def_nr
        Mesh *me = ob->data;
        BMEditMesh *em = me->edit_btmesh;
        BMVert *eve_mirr;
+       bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
 
-       eve_mirr = editbmesh_get_x_mirror_vert(ob, em, eve, eve->co, vidx);
+       eve_mirr = editbmesh_get_x_mirror_vert(ob, em, eve, eve->co, vidx, use_topology);
 
        if (eve_mirr && eve_mirr != eve) {
                MDeformVert *dvert_src = BM_ELEM_CD_GET_VOID_P(eve, cd_dvert_offset);
@@ -452,10 +453,12 @@ static void ED_mesh_defvert_mirror_update_ob(Object *ob, int def_nr, int vidx)
 {
        int vidx_mirr;
        Mesh *me = ob->data;
+       bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
+
        if (vidx == -1)
                return;
 
-       vidx_mirr = mesh_get_x_mirror_vert(ob, vidx);
+       vidx_mirr = mesh_get_x_mirror_vert(ob, vidx, use_topology);
 
        if ((vidx_mirr) >= 0 && (vidx_mirr != vidx)) {
                MDeformVert *dvert_src = &me->dvert[vidx];
@@ -557,16 +560,14 @@ static void vgroup_copy_active_to_sel(Object *ob, eVGroupSelect subset_type)
                const int cd_dvert_offset = CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT);
 
                dvert_act = ED_mesh_active_dvert_get_em(ob, &eve_act);
-               if (dvert_act == NULL) {
-                       return;
-               }
-
-               BM_ITER_MESH_INDEX (eve, &iter, em->bm, BM_VERTS_OF_MESH, i) {
-                       if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && eve != eve_act) {
-                               MDeformVert *dv = BM_ELEM_CD_GET_VOID_P(eve, cd_dvert_offset);
-                               defvert_copy_subset(dv, dvert_act, vgroup_validmap, vgroup_tot);
-                               if (me->editflag & ME_EDIT_MIRROR_X) {
-                                       ED_mesh_defvert_mirror_update_em(ob, eve, -1, i, cd_dvert_offset);
+               if (dvert_act) {
+                       BM_ITER_MESH_INDEX (eve, &iter, em->bm, BM_VERTS_OF_MESH, i) {
+                               if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && eve != eve_act) {
+                                       MDeformVert *dv = BM_ELEM_CD_GET_VOID_P(eve, cd_dvert_offset);
+                                       defvert_copy_subset(dv, dvert_act, vgroup_validmap, vgroup_tot);
+                                       if (me->editflag & ME_EDIT_MIRROR_X) {
+                                               ED_mesh_defvert_mirror_update_em(ob, eve, -1, i, cd_dvert_offset);
+                                       }
                                }
                        }
                }
@@ -576,16 +577,14 @@ static void vgroup_copy_active_to_sel(Object *ob, eVGroupSelect subset_type)
                int v_act;
 
                dvert_act = ED_mesh_active_dvert_get_ob(ob, &v_act);
-               if (dvert_act == NULL) {
-                       return;
-               }
-
-               dv  = me->dvert;
-               for (i = 0; i < me->totvert; i++, dv++) {
-                       if ((me->mvert[i].flag & SELECT) && dv != dvert_act) {
-                               defvert_copy_subset(dv, dvert_act, vgroup_validmap, vgroup_tot);
-                               if (me->editflag & ME_EDIT_MIRROR_X) {
-                                       ED_mesh_defvert_mirror_update_ob(ob, -1, i);
+               if (dvert_act) {
+                       dv  = me->dvert;
+                       for (i = 0; i < me->totvert; i++, dv++) {
+                               if ((me->mvert[i].flag & SELECT) && dv != dvert_act) {
+                                       defvert_copy_subset(dv, dvert_act, vgroup_validmap, vgroup_tot);
+                                       if (me->editflag & ME_EDIT_MIRROR_X) {
+                                               ED_mesh_defvert_mirror_update_ob(ob, -1, i);
+                                       }
                                }
                        }
                }
@@ -2318,7 +2317,8 @@ static void dvert_mirror_op(MDeformVert *dvert, MDeformVert *dvert_mirr,
 /* TODO, vgroup locking */
 /* TODO, face masking */
 void ED_vgroup_mirror(Object *ob,
-                      const bool mirror_weights, const bool flip_vgroups, const bool all_vgroups,
+                      const bool mirror_weights, const bool flip_vgroups,
+                      const bool all_vgroups, const bool use_topology,
                       int *r_totmirr, int *r_totfail)
 {
 
@@ -2375,7 +2375,7 @@ void ED_vgroup_mirror(Object *ob,
                                goto cleanup;
                        }
 
-                       EDBM_verts_mirror_cache_begin(em, 0, true, false);
+                       EDBM_verts_mirror_cache_begin(em, 0, true, false, use_topology);
 
                        /* Go through the list of editverts and assign them */
                        BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
@@ -2424,7 +2424,7 @@ void ED_vgroup_mirror(Object *ob,
 
                        for (vidx = 0, mv = me->mvert; vidx < me->totvert; vidx++, mv++) {
                                if ((mv->flag & ME_VERT_TMP_TAG) == 0) {
-                                       if ((vidx_mirr = mesh_get_x_mirror_vert(ob, vidx)) != -1) {
+                                       if ((vidx_mirr = mesh_get_x_mirror_vert(ob, vidx, use_topology)) != -1) {
                                                if (vidx != vidx_mirr) {
                                                        mv_mirr = &me->mvert[vidx_mirr];
                                                        if ((mv_mirr->flag & ME_VERT_TMP_TAG) == 0) {
@@ -2982,7 +2982,8 @@ static int vertex_group_vert_select_unlocked_poll(bContext *C)
                return 0;
 
        if (!(vgroup_object_in_edit_mode(ob) ||
-               vgroup_object_in_wpaint_vert_select(ob))) {
+           vgroup_object_in_wpaint_vert_select(ob)))
+       {
                return 0;
        }
 
@@ -3627,6 +3628,7 @@ static int vertex_group_mirror_exec(bContext *C, wmOperator *op)
                         RNA_boolean_get(op->ptr, "mirror_weights"),
                         RNA_boolean_get(op->ptr, "flip_group_names"),
                         RNA_boolean_get(op->ptr, "all_groups"),
+                        RNA_boolean_get(op->ptr, "use_topology"),
                         &totmirr, &totfail);
 
        ED_mesh_report_mirror(op, totmirr, totfail);
@@ -3657,7 +3659,8 @@ void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot)
        RNA_def_boolean(ot->srna, "mirror_weights", true, "Mirror Weights", "Mirror weights");
        RNA_def_boolean(ot->srna, "flip_group_names", true, "Flip Group Names", "Flip vertex group names");
        RNA_def_boolean(ot->srna, "all_groups", false, "All Groups", "Mirror all vertex groups weights");
-
+       RNA_def_boolean(ot->srna, "use_topology", 0, "Topology Mirror",
+                       "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
 }
 
 static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *UNUSED(op))
@@ -4153,15 +4156,15 @@ static bool check_vertex_group_accessible(wmOperator *op, Object *ob, int def_nr
 
        if (!dg) {
                BKE_report(op->reports, RPT_ERROR, "Invalid Weight Group Index");
-               return true;
+               return false;
        }
 
        if (dg->flag & DG_LOCK_WEIGHT) {
                BKE_report(op->reports, RPT_ERROR, "Weight Group is locked");
-               return true;
+               return false;
        }
 
-       return false;
+       return true;
 }
 
 static int vertex_weight_paste_exec(bContext *C, wmOperator *op)
@@ -4206,7 +4209,7 @@ static int vertex_weight_delete_exec(bContext *C, wmOperator *op)
        Object *ob = ED_object_context(C);
        const int def_nr = RNA_int_get(op->ptr, "weight_group");
 
-       if (check_vertex_group_accessible(op, ob, def_nr)) {
+       if (!check_vertex_group_accessible(op, ob, def_nr)) {
                return OPERATOR_CANCELLED;
        }
 
index c274135786f585db257be6a60caf55724905edbb..d9dc5648ae3e6d7573ee9cc9dce0fcd7c97eb017 100644 (file)
@@ -1639,7 +1639,7 @@ void ED_screen_full_restore(bContext *C, ScrArea *sa)
                if (sl->spacetype == SPACE_IMAGE) {
                        SpaceImage *sima = sa->spacedata.first;
 
-                       if(sima->flag & (SI_PREVSPACE|SI_FULLWINDOW)) {
+                       if (sima->flag & (SI_PREVSPACE | SI_FULLWINDOW)) {
                                sima->flag &= ~SI_PREVSPACE;
                                sima->flag &= ~SI_FULLWINDOW;
                                ED_screen_full_prevspace(C, sa);
index f4172d4ec80e469b2db3a561502058af87f9081c..c70841ffe82eac15b0764524f0d308508fcf9089 100644 (file)
@@ -599,13 +599,12 @@ static int actionzone_area_poll(bContext *C)
        wmWindow *win = CTX_wm_window(C);
        ScrArea *sa = CTX_wm_area(C);
        
-       if (sa && win) {
+       if (sa && win && win->eventstate) {
+               const int *xy = &win->eventstate->x;
                AZone *az;
-               int x = win->eventstate->x;
-               int y = win->eventstate->y;
                
                for (az = sa->actionzones.first; az; az = az->next)
-                       if (BLI_rcti_isect_pt(&az->rect, x, y))
+                       if (BLI_rcti_isect_pt_v(&az->rect, xy))
                                return 1;
        }
        return 0;
index b16721640da5835c8bce284da725c93eda5c3d5b..584d4cef1334ffab28dffb9b61ac236867ebff22 100644 (file)
@@ -511,7 +511,7 @@ void SCREEN_OT_screencast(wmOperatorType *ot)
        
        ot->invoke = WM_operator_confirm;
        ot->exec = screencast_exec;
-       ot->poll = WM_operator_winactive;
+       ot->poll = screenshot_poll;  /* shared poll */
        
        ot->flag = 0;
        
index 158a6a925365bfbf73099bcfe2c7650213e8d08b..173a76a54e89a163f80a3c251dc987f7258ead18 100644 (file)
@@ -482,6 +482,7 @@ bool ED_wpaint_fill(VPaint *wp, Object *ob, float paintweight)
        MDeformWeight *dw, *dw_prev;
        int vgroup_active, vgroup_mirror = -1;
        unsigned int index;
+       const bool topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
 
        /* mutually exclusive, could be made into a */
        const short paint_selmode = ME_EDIT_PAINT_SEL_MODE(me);
@@ -521,7 +522,7 @@ bool ED_wpaint_fill(VPaint *wp, Object *ob, float paintweight)
                                        dw->weight = paintweight;
 
                                        if (me->editflag & ME_EDIT_MIRROR_X) {  /* x mirror painting */
-                                               int j = mesh_get_x_mirror_vert(ob, vidx);
+                                               int j = mesh_get_x_mirror_vert(ob, vidx, topology);
                                                if (j >= 0) {
                                                        /* copy, not paint again */
                                                        if (vgroup_mirror != -1) {
@@ -1790,6 +1791,7 @@ static void do_weight_paint_vertex(
 {
        Mesh *me = ob->data;
        MDeformVert *dv = &me->dvert[index];
+       bool topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
        
        MDeformWeight *dw, *dw_prev;
 
@@ -1818,7 +1820,7 @@ static void do_weight_paint_vertex(
 
        /* from now on we can check if mirrors enabled if this var is -1 and not bother with the flag */
        if (me->editflag & ME_EDIT_MIRROR_X) {
-               index_mirr = mesh_get_x_mirror_vert(ob, index);
+               index_mirr = mesh_get_x_mirror_vert(ob, index, topology);
                vgroup_mirr = (wpi->vgroup_mirror != -1) ? wpi->vgroup_mirror : wpi->vgroup_active;
 
                /* another possible error - mirror group _and_ active group are the same (which is fine),
@@ -2340,10 +2342,16 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
        /* which faces are involved */
        if (use_depth) {
                if (wp->flag & VP_AREA) {
+                       char editflag_prev = me->editflag;
+
                        /* Ugly hack, to avoid drawing vertex index when getting the face index buffer - campbell */
                        me->editflag &= ~ME_EDIT_PAINT_VERT_SEL;
+                       if (use_vert_sel) {
+                               /* Ugly x2, we need this so hidden faces don't draw */
+                               me->editflag |= ME_EDIT_PAINT_FACE_SEL;
+                       }
                        totindex = sample_backbuf_area(vc, indexar, me->totpoly, mval[0], mval[1], brush_size_pressure);
-                       me->editflag |= use_vert_sel ? ME_EDIT_PAINT_VERT_SEL : 0;
+                       me->editflag = editflag_prev;
                }
                else {
                        indexar[0] = view3d_sample_backbuf(vc, mval[0], mval[1]);
index c33cf68a20a9efd236ebd8420a95a9312f45088f..18248f4775be8eeec1ede5ab1fc80ad815b3e610 100644 (file)
@@ -446,7 +446,7 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
                else
                        tip = TIP_("Marker is enabled at current frame");
 
-               uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, IFACE_("Enabled"), 10, 190, 145, 19,
+               uiDefButBitI(block, OPTIONN, MARKER_DISABLED, B_MARKER_FLAG, IFACE_("Enabled"), 0.5 * UI_UNIT_X, 9.5 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y,
                             &cb->marker_flag, 0, 0, 0, 0, tip);
 
                col = uiLayoutColumn(layout, TRUE);
@@ -455,33 +455,33 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
                block = uiLayoutAbsoluteBlock(col);
                uiBlockBeginAlign(block);
 
-               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],
+               uiDefBut(block, LABEL, 0, IFACE_("Position:"), 0, 10 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+               uiDefButF(block, NUM, B_MARKER_POS, IFACE_("X:"), 0.5 * UI_UNIT_X, 9 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &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],
+               uiDefButF(block, NUM, B_MARKER_POS, IFACE_("Y:"), 8.25 * UI_UNIT_X, 9 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &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],
+               uiDefBut(block, LABEL, 0, IFACE_("Offset:"), 0, 8 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+               uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("X:"), 0.5 * UI_UNIT_X, 7 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &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],
+               uiDefButF(block, NUM, B_MARKER_OFFSET, IFACE_("Y:"), 8.25 * UI_UNIT_X, 7 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &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,
+               uiDefBut(block, LABEL, 0, IFACE_("Pattern Area:"), 0, 6 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+               uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Width:"), 0.5 * UI_UNIT_X, 5 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &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,
+               uiDefButF(block, NUM, B_MARKER_PAT_DIM, IFACE_("Height:"), 0.5 * UI_UNIT_X, 4 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &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],
+               uiDefBut(block, LABEL, 0, IFACE_("Search Area:"), 0, 3 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+               uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("X:"), 0.5 * UI_UNIT_X, 2 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &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],
+               uiDefButF(block, NUM, B_MARKER_SEARCH_POS, IFACE_("Y:"), 8.25 * UI_UNIT_X, 2 * UI_UNIT_Y, 7.25 * UI_UNIT_X, UI_UNIT_Y, &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,
+               uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Width:"), 0.5 * UI_UNIT_X, 1 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &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,
+               uiDefButF(block, NUM, B_MARKER_SEARCH_DIM, IFACE_("Height:"), 0.5 * UI_UNIT_X, 0 * UI_UNIT_Y, 15 * UI_UNIT_X, UI_UNIT_Y, &cb->marker_search[1], 3.0f,
                          10.0 * height, step, digits, TIP_("Height of marker's search in screen coordinates"));
 
                uiBlockEndAlign(block);
index 382b0b75c5e9448c2be03a2815d152a9043cc9d7..059b8ace7b909f91755226113d943e44256808c7 100644 (file)
@@ -316,7 +316,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
         */
        y = (float) CHANNEL_FIRST;
 
-       BLF_size(fontid, 11.0f, U.dpi);
+       BLF_size(fontid, 11.0f * U.pixelsize, U.dpi);
 
        for (channel = dopesheet->channels.first; channel; channel = channel->next) {
                float yminc = (float) (y - CHANNEL_HEIGHT_HALF);
index f00f5d5dfdd8462cc43733112910a3d855b9491a..8f9893e3bce3f566e8340bf3ddb72a46b1da2bec 100644 (file)
@@ -775,7 +775,7 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa)
                 * a menu might be nicer but would be tricky as we need some custom filtering
                 */
                uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"),
-                         10, 0, 150, 20, TIP_("Adds a new F-Curve Modifier for the active F-Curve"));
+                         0.5 * UI_UNIT_X, 0, 7.5 * UI_UNIT_X, UI_UNIT_Y, TIP_("Adds a new F-Curve Modifier for the active F-Curve"));
                
                /* copy/paste (as sub-row)*/
                row = uiLayoutRow(row, TRUE);
index bdf93b98f22c47db874dbca07810d98ea8205885..7610f7a91929fb6a87e74c6199ab301788b8fca7 100644 (file)
@@ -214,7 +214,7 @@ static void draw_fcurve_vertices_handles(FCurve *fcu, SpaceIpo *sipo, View2D *v2
        int i;
        
        /* get view settings */
-       hsize = UI_GetThemeValuef(TH_HANDLE_VERTEX_SIZE);
+       hsize = UI_GetThemeValuef(TH_HANDLE_VERTEX_SIZE) * U.pixelsize;
        UI_view2d_getscale(v2d, &xscale, &yscale);
        
        /* set handle color */
index 17a5dda09b09ef3b6d8315bfd9cff2350fd3d83b..a845f8e525c33fa57ff9b992563786506c7427f7 100644 (file)
@@ -1360,7 +1360,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
                        Scene *scene = CTX_data_scene(C);
                        RenderResult *rr = BKE_image_acquire_renderresult(scene, ima);
                        if (rr) {
-                               RE_WriteRenderResult(op->reports, rr, simopts->filepath, simopts->im_format.quality);
+                               RE_WriteRenderResult(op->reports, rr, simopts->filepath, simopts->im_format.exr_codec);
                                ok = TRUE;
                        }
                        else {
index 46feea6a5533eb7c097af54b01b6dccb69797c50..3b769761dfb6aa67c8ce5085a73e6b31c2470b3c 100644 (file)
@@ -1059,9 +1059,9 @@ static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, Spa
                                
 
                                dx = (int)UI_GetStringWidth(te->name);
-                               if (dx < 5*UI_UNIT_X) dx = 5*UI_UNIT_X;
+                               if (dx < 5 * UI_UNIT_X) dx = 5 * UI_UNIT_X;
                                spx = te->xs + 1.8f * UI_UNIT_X;
-                               if (spx + dx + 0.5f*UI_UNIT_X > ar->v2d.cur.xmax) dx = ar->v2d.cur.xmax - spx - 0.5f*UI_UNIT_X;
+                               if (spx + dx + 0.5f * UI_UNIT_X > ar->v2d.cur.xmax) dx = ar->v2d.cur.xmax - spx - 0.5f * UI_UNIT_X;
 
                                bt = uiDefBut(block, TEX, OL_NAMEBUTTON, "", spx, (int)te->ys, dx + UI_UNIT_X, UI_UNIT_Y - 1, (void *)te->name,
                                              1.0, (float)len, 0, 0, "");
index 8074ec57474a28acc63bddb9e7e430b52ad27db3..9df849410f42edb171e04a090671800bbc21b877 100644 (file)
 #include "BLI_utildefines.h"
 
 #include "BKE_context.h"
+#include "BKE_report.h"
 #include "BKE_global.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
+#include "wm_event_system.h"
 
 #include "RNA_access.h"
 #include "RNA_define.h"
@@ -84,10 +86,41 @@ void SCRIPT_OT_python_file_run(wmOperatorType *ot)
        RNA_def_string_file_path(ot->srna, "filepath", "", FILE_MAX, "Path", "");
 }
 
+#ifdef WITH_PYTHON
+static bool script_test_modal_operators(bContext *C)
+{
+       wmWindowManager *wm;
+       wmWindow *win;
+
+       wm = CTX_wm_manager(C);
+
+       for (win = wm->windows.first; win; win = win->next) {
+               wmEventHandler *handler;
+
+               for (handler = win->modalhandlers.first; handler; handler = handler->next) {
+                       if (handler->op) {
+                               wmOperatorType *ot = handler->op->type;
+                               if (ot->ext.srna) {
+                                       return true;
+                               }
+                       }
+               }
+       }
+
+       return false;
+}
+#endif
 
-static int script_reload_exec(bContext *C, wmOperator *UNUSED(op))
+static int script_reload_exec(bContext *C, wmOperator *op)
 {
 #ifdef WITH_PYTHON
+
+       /* clear running operators */
+       if (script_test_modal_operators(C)) {
+               BKE_report(op->reports, RPT_ERROR, "Can't reload with running modal operators");
+               return OPERATOR_CANCELLED;
+       }
+
        /* TODO, this crashes on netrender and keying sets, need to look into why
         * disable for now unless running in debug mode */
        WM_cursor_wait(1);
@@ -96,7 +129,7 @@ static int script_reload_exec(bContext *C, wmOperator *UNUSED(op))
        WM_event_add_notifier(C, NC_WINDOW, NULL);
        return OPERATOR_FINISHED;
 #else
-       (void)C; /* unused */
+       (void)C, (void)op; /* unused */
        return OPERATOR_CANCELLED;
 #endif
 }
index 6a836c4af13190d8dfcaf0760c0d8fc12f5b81c6..7525b799067aa0a10e0522d0f480b308d3142850 100644 (file)
@@ -1004,45 +1004,83 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d,
 }
 
 /* Vertex Paint and Weight Paint */
+void draw_mesh_paint_weight_faces(DerivedMesh *dm, const bool use_light,
+                                  void *facemask_cb, void *user_data)
+{
+       if (use_light) {
+               const float spec[4] = {0.47f, 0.47f, 0.47f, 0.47f};
+
+               /* but set default spec */
+               glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
+               glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, spec);
+
+               /* diffuse */
+               glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
+               glEnable(GL_LIGHTING);
+               glEnable(GL_COLOR_MATERIAL);
+       }
+
+       dm->drawMappedFaces(dm, (DMSetDrawOptions)facemask_cb, GPU_enable_material, NULL, user_data,
+                           DM_DRAW_USE_COLORS | DM_DRAW_ALWAYS_SMOOTH);
+
+       if (use_light) {
+               glDisable(GL_COLOR_MATERIAL);
+               glDisable(GL_LIGHTING);
+
+               GPU_disable_material();
+       }
+}
+
+void draw_mesh_paint_weight_edges(RegionView3D *rv3d, DerivedMesh *dm, const bool use_depth,
+                                  void *edgemask_cb, void *user_data)
+{
+       /* weight paint in solid mode, special case. focus on making the weights clear
+        * rather than the shading, this is also forced in wire view */
+
+       if (use_depth) {
+               bglPolygonOffset(rv3d->dist, 1.0);
+               glDepthMask(0);  /* disable write in zbuffer, selected edge wires show better */
+       }
+       else {
+               glDisable(GL_DEPTH_TEST);
+       }
+
+       glEnable(GL_BLEND);
+       glColor4ub(255, 255, 255, 96);
+       glEnable(GL_LINE_STIPPLE);
+       glLineStipple(1, 0xAAAA);
+
+       dm->drawMappedEdges(dm, (DMSetDrawOptions)edgemask_cb, user_data);
+
+       if (use_depth) {
+               bglPolygonOffset(rv3d->dist, 0.0);
+               glDepthMask(1);
+       }
+       else {
+               glEnable(GL_DEPTH_TEST);
+       }
+
+       glDisable(GL_LINE_STIPPLE);
+       glDisable(GL_BLEND);
+}
 
 void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d,
                      Object *ob, DerivedMesh *dm, const int draw_flags)
 {
        DMSetDrawOptions facemask = NULL;
        Mesh *me = ob->data;
-       const bool do_light = (v3d->drawtype >= OB_SOLID);
+       const bool use_light = (v3d->drawtype >= OB_SOLID);
 
        /* hide faces in face select mode */
        if (me->editflag & (ME_EDIT_PAINT_VERT_SEL | ME_EDIT_PAINT_FACE_SEL))
                facemask = wpaint__setSolidDrawOptions_facemask;
 
        if (ob->mode & OB_MODE_WEIGHT_PAINT) {
-
-               if (do_light) {
-                       const float spec[4] = {0.47f, 0.47f, 0.47f, 0.47f};
-
-                       /* enforce default material settings */
+               if (use_light) {
                        GPU_enable_material(0, NULL);
-               
-                       /* but set default spec */
-                       glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
-                       glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, spec);
-
-                       /* diffuse */
-                       glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
-                       glEnable(GL_LIGHTING);
-                       glEnable(GL_COLOR_MATERIAL);
                }
 
-               dm->drawMappedFaces(dm, facemask, GPU_enable_material, NULL, me,
-                                   DM_DRAW_USE_COLORS | DM_DRAW_ALWAYS_SMOOTH);
-
-               if (do_light) {
-                       glDisable(GL_COLOR_MATERIAL);
-                       glDisable(GL_LIGHTING);
-
-                       GPU_disable_material();
-               }
+               draw_mesh_paint_weight_faces(dm, use_light, facemask, me);
        }
        else if (ob->mode & OB_MODE_VERTEX_PAINT) {
                if (me->mloopcol) {
@@ -1060,37 +1098,9 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d,
        if (draw_flags & DRAW_FACE_SELECT) {
                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) || !(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 */
-
-               if (use_depth) {
-                       bglPolygonOffset(rv3d->dist, 1.0);
-                       glDepthMask(0);  /* disable write in zbuffer, selected edge wires show better */
-               }
-               else {
-                       glDisable(GL_DEPTH_TEST);
-               }
-
-               glEnable(GL_BLEND);
-               glColor4ub(255, 255, 255, 96);
-               glEnable(GL_LINE_STIPPLE);
-               glLineStipple(1, 0xAAAA);
-
-               dm->drawEdges(dm, 1, 1);
-
-               if (use_depth) {
-                       bglPolygonOffset(rv3d->dist, 0.0);
-                       glDepthMask(1);
-               }
-               else {
-                       glEnable(GL_DEPTH_TEST);
-               }
-
-               glDisable(GL_LINE_STIPPLE);
-               glDisable(GL_BLEND);
+       else if ((use_light == false) || (ob->dtx & OB_DRAWWIRE)) {
+               const bool use_depth = (v3d->flag & V3D_ZBUF_SELECT) || !(ob->mode & OB_MODE_WEIGHT_PAINT);
+               draw_mesh_paint_weight_edges(rv3d, dm, use_depth, NULL, NULL);
        }
 }
 
index 1ce8cf9082eba8853617a0f9a6a24edbe786bb0b..9ab6336ab0e7cb31df1293681b74f87606b2eac8 100644 (file)
@@ -179,7 +179,7 @@ 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 bool check_object_draw_texture(Scene *scene, View3D *v3d, int drawtype)
+static bool check_object_draw_texture(Scene *scene, View3D *v3d, const char drawtype)
 {
        /* texture and material draw modes */
        if (ELEM(v3d->drawtype, OB_TEXTURE, OB_MATERIAL) && drawtype > OB_SOLID) {
@@ -201,6 +201,18 @@ static bool check_object_draw_texture(Scene *scene, View3D *v3d, int drawtype)
        return false;
 }
 
+static bool check_object_draw_editweight(Mesh *me, DerivedMesh *finalDM)
+{
+       if (me->drawflag & ME_DRAWEIGHT) {
+               /* editmesh handles its own weight drawing */
+               if (finalDM->type != DM_TYPE_EDITBMESH) {
+                       return true;
+               }
+       }
+
+       return false;
+}
+
 static bool check_ob_drawface_dot(Scene *sce, View3D *vd, char dt)
 {
        if ((sce->toolsettings->selectmode & SCE_SELECT_FACE) == 0)
@@ -3030,7 +3042,21 @@ static void draw_em_fancy(Scene *scene, ARegion *ar, View3D *v3d,
        
        EDBM_index_arrays_ensure(em, BM_VERT | BM_EDGE | BM_FACE);
 
-       if (dt > OB_WIRE) {
+       if (check_object_draw_editweight(me, finalDM)) {
+               if (dt > OB_WIRE) {
+                       draw_mesh_paint_weight_faces(finalDM, true, draw_em_fancy__setFaceOpts, me->edit_btmesh);
+
+                       bglPolygonOffset(rv3d->dist, 1.0);
+                       glDepthMask(0);
+               }
+               else {
+                       glEnable(GL_DEPTH_TEST);
+                       draw_mesh_paint_weight_faces(finalDM, false, draw_em_fancy__setFaceOpts, me->edit_btmesh);
+                       draw_mesh_paint_weight_edges(rv3d, finalDM, true, draw_dm_edges__setDrawOptions, me->edit_btmesh);
+                       glDisable(GL_DEPTH_TEST);
+               }
+       }
+       else if (dt > OB_WIRE) {
                if (check_object_draw_texture(scene, v3d, dt)) {
                        if (draw_glsl_material(scene, ob, v3d, dt)) {
                                glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
index a1df2568f73cf78f3407769c719212d192b90d7a..0a2358aa137a3f694044e344261be9a294bc31d8 100644 (file)
@@ -592,7 +592,7 @@ static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d)
  * colors copied from transform_manipulator.c, we should keep these matching. */
 static void draw_view_axis(RegionView3D *rv3d, rcti *rect)
 {
-       const float k = U.rvisize;   /* axis size */
+       const float k = U.rvisize * U.pixelsize;   /* axis size */
        const float toll = 0.5;      /* used to see when view is quasi-orthogonal */
        float startx = k + 1.0f; /* axis center in screen coordinates, x=y */
        float starty = k + 1.0f;
index f5ffd10c272b0d1e3f46a4f1b100ded8f9fe152a..44c857998964d50c253a5a42b574dee031099054 100644 (file)
@@ -150,6 +150,10 @@ bool draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
 void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d,
                         struct Object *ob, struct DerivedMesh *dm, const int draw_flags);
 void draw_mesh_face_select(struct RegionView3D *rv3d, struct Mesh *me, struct DerivedMesh *dm);
+void draw_mesh_paint_weight_faces(struct DerivedMesh *dm, const bool do_light,
+                                  void *facemask_cb, void *user_data);
+void draw_mesh_paint_weight_edges(RegionView3D *rv3d, struct DerivedMesh *dm, const bool use_depth,
+                                  void *edgemask_cb, void *user_data);
 void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d,
                      struct Object *ob, struct DerivedMesh *dm, const int draw_flags);
 
index d243f355b5c39a032911cdaf481e7e29af6355f3..1678487d8bfffc92d06b72340ed1c8ab9fdfc044 100644 (file)
@@ -54,6 +54,7 @@
 #include "BKE_depsgraph.h"
 #include "BKE_lattice.h"
 #include "BKE_main.h"
+#include "BKE_mball.h"
 #include "BKE_object.h"
 #include "BKE_editmesh.h"
 #include "BKE_DerivedMesh.h"
@@ -1089,6 +1090,19 @@ bool ED_view3d_minmax_verts(Object *obedit, float min[3], float max[3])
        float centroid[3], vec[3], bmat[3][3];
        int a;
 
+       /* metaballs are an exception */
+       if (obedit->type == OB_MBALL) {
+               float ob_min[3], ob_max[3];
+               bool change;
+
+               change = BKE_mball_minmax_ex(obedit->data, ob_min, ob_max, obedit->obmat, SELECT);
+               if (change) {
+                       minmax_v3v3_v3(min, max, ob_min);
+                       minmax_v3v3_v3(min, max, ob_max);
+               }
+               return change;
+       }
+
        tottrans = 0;
        if (ELEM5(obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE))
                make_trans_verts(obedit, bmat[0], bmat[1], TM_ALL_JOINTS);
index 44c2158bf74c3ea1e57b6f46a8b31b2d3f56a9c5..a089f0d4159aeb05aff21ce9758b15db149ed9b2 100644 (file)
@@ -2023,6 +2023,7 @@ static void createTransEditVerts(TransInfo *t)
        TransData *tob = NULL;
        TransDataExtension *tx = NULL;
        BMEditMesh *em = BKE_editmesh_from_object(t->obedit);
+       Mesh *me = t->obedit->data;
        BMesh *bm = em->bm;
        BMVert *eve;
        BMIter iter;
@@ -2036,9 +2037,10 @@ static void createTransEditVerts(TransInfo *t)
        char *selstate = NULL;
        short selectmode = ts->selectmode;
        int cd_vert_bweight_offset = -1;
+       bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0;
 
        if (t->flag & T_MIRROR) {
-               EDBM_verts_mirror_cache_begin(em, 0, false, (t->flag & T_PROP_EDIT) == 0);
+               EDBM_verts_mirror_cache_begin(em, 0, false, (t->flag & T_PROP_EDIT) == 0, use_topology);
                mirror = 1;
        }
 
index cfdbf87785e6ef5e34d9f426594afe08492a5c6d..9dc98e59c42440c8064b4df59078054723008e94 100644 (file)
@@ -1889,365 +1889,388 @@ void GPU_state_init(void)
 
 #ifdef DEBUG
 /* debugging aid */
-static void gpu_get_print(const char *name, GLenum type)
+static void gpu_state_print_fl_ex(const char *name, GLenum type)
 {
+       const unsigned char err_mark[4] = {0xff, 0xff, 0xff, 0xff};
+
        float value[32];
        int a;
-       
-       memset(value, 0, sizeof(value));
+
+       memset(value, 0xff, sizeof(value));
        glGetFloatv(type, value);
 
        printf("%s: ", name);
-       for (a = 0; a < 32; a++)
+       for (a = 0; a < 32; a++) {
+               if (memcmp(&value[a], err_mark, sizeof(value[a])) == 0) {
+                       break;
+               }
                printf("%.2f ", value[a]);
+       }
        printf("\n");
 }
 
+#define gpu_state_print_fl(val) gpu_state_print_fl_ex(#val, val)
+
 void GPU_state_print(void)
 {
-       gpu_get_print("GL_ACCUM_ALPHA_BITS", GL_ACCUM_ALPHA_BITS);
-       gpu_get_print("GL_ACCUM_BLUE_BITS", GL_ACCUM_BLUE_BITS);
-       gpu_get_print("GL_ACCUM_CLEAR_VALUE", GL_ACCUM_CLEAR_VALUE);
-       gpu_get_print("GL_ACCUM_GREEN_BITS", GL_ACCUM_GREEN_BITS);
-       gpu_get_print("GL_ACCUM_RED_BITS", GL_ACCUM_RED_BITS);
-       gpu_get_print("GL_ACTIVE_TEXTURE", GL_ACTIVE_TEXTURE);
-       gpu_get_print("GL_ALIASED_POINT_SIZE_RANGE", GL_ALIASED_POINT_SIZE_RANGE);
-       gpu_get_print("GL_ALIASED_LINE_WIDTH_RANGE", GL_ALIASED_LINE_WIDTH_RANGE);
-       gpu_get_print("GL_ALPHA_BIAS", GL_ALPHA_BIAS);
-       gpu_get_print("GL_ALPHA_BITS", GL_ALPHA_BITS);
-       gpu_get_print("GL_ALPHA_SCALE", GL_ALPHA_SCALE);
-       gpu_get_print("GL_ALPHA_TEST", GL_ALPHA_TEST);
-       gpu_get_print("GL_ALPHA_TEST_FUNC", GL_ALPHA_TEST_FUNC);
-       gpu_get_print("GL_ALPHA_TEST_REF", GL_ALPHA_TEST_REF);
-       gpu_get_print("GL_ARRAY_BUFFER_BINDING", GL_ARRAY_BUFFER_BINDING);
-       gpu_get_print("GL_ATTRIB_STACK_DEPTH", GL_ATTRIB_STACK_DEPTH);
-       gpu_get_print("GL_AUTO_NORMAL", GL_AUTO_NORMAL);
-       gpu_get_print("GL_AUX_BUFFERS", GL_AUX_BUFFERS);
-       gpu_get_print("GL_BLEND", GL_BLEND);
-       gpu_get_print("GL_BLEND_COLOR", GL_BLEND_COLOR);
-       gpu_get_print("GL_BLEND_DST_ALPHA", GL_BLEND_DST_ALPHA);
-       gpu_get_print("GL_BLEND_DST_RGB", GL_BLEND_DST_RGB);
-       gpu_get_print("GL_BLEND_EQUATION_RGB", GL_BLEND_EQUATION_RGB);
-       gpu_get_print("GL_BLEND_EQUATION_ALPHA", GL_BLEND_EQUATION_ALPHA);
-       gpu_get_print("GL_BLEND_SRC_ALPHA", GL_BLEND_SRC_ALPHA);
-       gpu_get_print("GL_BLEND_SRC_RGB", GL_BLEND_SRC_RGB);
-       gpu_get_print("GL_BLUE_BIAS", GL_BLUE_BIAS);
-       gpu_get_print("GL_BLUE_BITS", GL_BLUE_BITS);
-       gpu_get_print("GL_BLUE_SCALE", GL_BLUE_SCALE);
-       gpu_get_print("GL_CLIENT_ACTIVE_TEXTURE", GL_CLIENT_ACTIVE_TEXTURE);
-       gpu_get_print("GL_CLIENT_ATTRIB_STACK_DEPTH", GL_CLIENT_ATTRIB_STACK_DEPTH);
-       gpu_get_print("GL_CLIP_PLANE0", GL_CLIP_PLANE0);
-       gpu_get_print("GL_COLOR_ARRAY", GL_COLOR_ARRAY);
-       gpu_get_print("GL_COLOR_ARRAY_BUFFER_BINDING", GL_COLOR_ARRAY_BUFFER_BINDING);
-       gpu_get_print("GL_COLOR_ARRAY_SIZE", GL_COLOR_ARRAY_SIZE);
-       gpu_get_print("GL_COLOR_ARRAY_STRIDE", GL_COLOR_ARRAY_STRIDE);
-       gpu_get_print("GL_COLOR_ARRAY_TYPE", GL_COLOR_ARRAY_TYPE);
-       gpu_get_print("GL_COLOR_CLEAR_VALUE", GL_COLOR_CLEAR_VALUE);
-       gpu_get_print("GL_COLOR_LOGIC_OP", GL_COLOR_LOGIC_OP);
-       gpu_get_print("GL_COLOR_MATERIAL", GL_COLOR_MATERIAL);
-       gpu_get_print("GL_COLOR_MATERIAL_FACE", GL_COLOR_MATERIAL_FACE);
-       gpu_get_print("GL_COLOR_MATERIAL_PARAMETER", GL_COLOR_MATERIAL_PARAMETER);
-       gpu_get_print("GL_COLOR_MATRIX", GL_COLOR_MATRIX);
-       gpu_get_print("GL_COLOR_MATRIX_STACK_DEPTH", GL_COLOR_MATRIX_STACK_DEPTH);
-       gpu_get_print("GL_COLOR_SUM", GL_COLOR_SUM);
-       gpu_get_print("GL_COLOR_TABLE", GL_COLOR_TABLE);
-       gpu_get_print("GL_COLOR_WRITEMASK", GL_COLOR_WRITEMASK);
-       gpu_get_print("GL_COMPRESSED_TEXTURE_FORMATS", GL_COMPRESSED_TEXTURE_FORMATS);
-       gpu_get_print("GL_CONVOLUTION_1D", GL_CONVOLUTION_1D);
-       gpu_get_print("GL_CONVOLUTION_2D", GL_CONVOLUTION_2D);
-       gpu_get_print("GL_CULL_FACE", GL_CULL_FACE);
-       gpu_get_print("GL_CULL_FACE_MODE", GL_CULL_FACE_MODE);
-       gpu_get_print("GL_CURRENT_COLOR", GL_CURRENT_COLOR);
-       gpu_get_print("GL_CURRENT_FOG_COORD", GL_CURRENT_FOG_COORD);
-       gpu_get_print("GL_CURRENT_INDEX", GL_CURRENT_INDEX);
-       gpu_get_print("GL_CURRENT_NORMAL", GL_CURRENT_NORMAL);
-       gpu_get_print("GL_CURRENT_PROGRAM", GL_CURRENT_PROGRAM);
-       gpu_get_print("GL_CURRENT_RASTER_COLOR", GL_CURRENT_RASTER_COLOR);
-       gpu_get_print("GL_CURRENT_RASTER_DISTANCE", GL_CURRENT_RASTER_DISTANCE);
-       gpu_get_print("GL_CURRENT_RASTER_INDEX", GL_CURRENT_RASTER_INDEX);
-       gpu_get_print("GL_CURRENT_RASTER_POSITION", GL_CURRENT_RASTER_POSITION);
-       gpu_get_print("GL_CURRENT_RASTER_POSITION_VALID", GL_CURRENT_RASTER_POSITION_VALID);
-       gpu_get_print("GL_CURRENT_RASTER_SECONDARY_COLOR", GL_CURRENT_RASTER_SECONDARY_COLOR);
-       gpu_get_print("GL_CURRENT_RASTER_TEXTURE_COORDS", GL_CURRENT_RASTER_TEXTURE_COORDS);
-       gpu_get_print("GL_CURRENT_SECONDARY_COLOR", GL_CURRENT_SECONDARY_COLOR);
-       gpu_get_print("GL_CURRENT_TEXTURE_COORDS", GL_CURRENT_TEXTURE_COORDS);
-       gpu_get_print("GL_DEPTH_BIAS", GL_DEPTH_BIAS);
-       gpu_get_print("GL_DEPTH_BITS", GL_DEPTH_BITS);
-       gpu_get_print("GL_DEPTH_CLEAR_VALUE", GL_DEPTH_CLEAR_VALUE);
-       gpu_get_print("GL_DEPTH_FUNC", GL_DEPTH_FUNC);
-       gpu_get_print("GL_DEPTH_RANGE", GL_DEPTH_RANGE);
-       gpu_get_print("GL_DEPTH_SCALE", GL_DEPTH_SCALE);
-       gpu_get_print("GL_DEPTH_TEST", GL_DEPTH_TEST);
-       gpu_get_print("GL_DEPTH_WRITEMASK", GL_DEPTH_WRITEMASK);
-       gpu_get_print("GL_DITHER", GL_DITHER);
-       gpu_get_print("GL_DOUBLEBUFFER", GL_DOUBLEBUFFER);
-       gpu_get_print("GL_DRAW_BUFFER", GL_DRAW_BUFFER);
-       gpu_get_print("GL_DRAW_BUFFER0", GL_DRAW_BUFFER0);
-       gpu_get_print("GL_EDGE_FLAG", GL_EDGE_FLAG);
-       gpu_get_print("GL_EDGE_FLAG_ARRAY", GL_EDGE_FLAG_ARRAY);
-       gpu_get_print("GL_EDGE_FLAG_ARRAY_BUFFER_BINDING", GL_EDGE_FLAG_ARRAY_BUFFER_BINDING);
-       gpu_get_print("GL_EDGE_FLAG_ARRAY_STRIDE", GL_EDGE_FLAG_ARRAY_STRIDE);
-       gpu_get_print("GL_ELEMENT_ARRAY_BUFFER_BINDING", GL_ELEMENT_ARRAY_BUFFER_BINDING);
-       gpu_get_print("GL_FEEDBACK_BUFFER_SIZE", GL_FEEDBACK_BUFFER_SIZE);
-       gpu_get_print("GL_FEEDBACK_BUFFER_TYPE", GL_FEEDBACK_BUFFER_TYPE);
-       gpu_get_print("GL_FOG", GL_FOG);
-       gpu_get_print("GL_FOG_COORD_ARRAY", GL_FOG_COORD_ARRAY);
-       gpu_get_print("GL_FOG_COORD_ARRAY_BUFFER_BINDING", GL_FOG_COORD_ARRAY_BUFFER_BINDING);
-       gpu_get_print("GL_FOG_COORD_ARRAY_STRIDE", GL_FOG_COORD_ARRAY_STRIDE);
-       gpu_get_print("GL_FOG_COORD_ARRAY_TYPE", GL_FOG_COORD_ARRAY_TYPE);
-       gpu_get_print("GL_FOG_COORD_SRC", GL_FOG_COORD_SRC);
-       gpu_get_print("GL_FOG_COLOR", GL_FOG_COLOR);
-       gpu_get_print("GL_FOG_DENSITY", GL_FOG_DENSITY);
-       gpu_get_print("GL_FOG_END", GL_FOG_END);
-       gpu_get_print("GL_FOG_HINT", GL_FOG_HINT);
-       gpu_get_print("GL_FOG_INDEX", GL_FOG_INDEX);
-       gpu_get_print("GL_FOG_MODE", GL_FOG_MODE);
-       gpu_get_print("GL_FOG_START", GL_FOG_START);
-       gpu_get_print("GL_FRAGMENT_SHADER_DERIVATIVE_HINT", GL_FRAGMENT_SHADER_DERIVATIVE_HINT);
-       gpu_get_print("GL_FRONT_FACE", GL_FRONT_FACE);
-       gpu_get_print("GL_GENERATE_MIPMAP_HINT", GL_GENERATE_MIPMAP_HINT);
-       gpu_get_print("GL_GREEN_BIAS", GL_GREEN_BIAS);
-       gpu_get_print("GL_GREEN_BITS", GL_GREEN_BITS);
-       gpu_get_print("GL_GREEN_SCALE", GL_GREEN_SCALE);
-       gpu_get_print("GL_HISTOGRAM", GL_HISTOGRAM);
-       gpu_get_print("GL_INDEX_ARRAY", GL_INDEX_ARRAY);
-       gpu_get_print("GL_INDEX_ARRAY_BUFFER_BINDING", GL_INDEX_ARRAY_BUFFER_BINDING);
-       gpu_get_print("GL_INDEX_ARRAY_STRIDE", GL_INDEX_ARRAY_STRIDE);
-       gpu_get_print("GL_INDEX_ARRAY_TYPE", GL_INDEX_ARRAY_TYPE);
-       gpu_get_print("GL_INDEX_BITS", GL_INDEX_BITS);
-       gpu_get_print("GL_INDEX_CLEAR_VALUE", GL_INDEX_CLEAR_VALUE);
-       gpu_get_print("GL_INDEX_LOGIC_OP", GL_INDEX_LOGIC_OP);
-       gpu_get_print("GL_INDEX_MODE", GL_INDEX_MODE);
-       gpu_get_print("GL_INDEX_OFFSET", GL_INDEX_OFFSET);
-       gpu_get_print("GL_INDEX_SHIFT", GL_INDEX_SHIFT);
-       gpu_get_print("GL_INDEX_WRITEMASK", GL_INDEX_WRITEMASK);
-       gpu_get_print("GL_LIGHT0", GL_LIGHT0);
-       gpu_get_print("GL_LIGHTING", GL_LIGHTING);
-       gpu_get_print("GL_LIGHT_MODEL_AMBIENT", GL_LIGHT_MODEL_AMBIENT);
-       gpu_get_print("GL_LIGHT_MODEL_COLOR_CONTROL", GL_LIGHT_MODEL_COLOR_CONTROL);
-       gpu_get_print("GL_LIGHT_MODEL_LOCAL_VIEWER", GL_LIGHT_MODEL_LOCAL_VIEWER);
-       gpu_get_print("GL_LIGHT_MODEL_TWO_SIDE", GL_LIGHT_MODEL_TWO_SIDE);
-       gpu_get_print("GL_LINE_SMOOTH", GL_LINE_SMOOTH);
-       gpu_get_print("GL_LINE_SMOOTH_HINT", GL_LINE_SMOOTH_HINT);
-       gpu_get_print("GL_LINE_STIPPLE", GL_LINE_STIPPLE);
-       gpu_get_print("GL_LINE_STIPPLE_PATTERN", GL_LINE_STIPPLE_PATTERN);
-       gpu_get_print("GL_LINE_STIPPLE_REPEAT", GL_LINE_STIPPLE_REPEAT);
-       gpu_get_print("GL_LINE_WIDTH", GL_LINE_WIDTH);
-       gpu_get_print("GL_LINE_WIDTH_GRANULARITY", GL_LINE_WIDTH_GRANULARITY);
-       gpu_get_print("GL_LINE_WIDTH_RANGE", GL_LINE_WIDTH_RANGE);
-       gpu_get_print("GL_LIST_BASE", GL_LIST_BASE);
-       gpu_get_print("GL_LIST_INDEX", GL_LIST_INDEX);
-       gpu_get_print("GL_LIST_MODE", GL_LIST_MODE);
-       gpu_get_print("GL_LOGIC_OP_MODE", GL_LOGIC_OP_MODE);
-       gpu_get_print("GL_MAP1_COLOR_4", GL_MAP1_COLOR_4);
-       gpu_get_print("GL_MAP1_GRID_DOMAIN", GL_MAP1_GRID_DOMAIN);
-       gpu_get_print("GL_MAP1_GRID_SEGMENTS", GL_MAP1_GRID_SEGMENTS);
-       gpu_get_print("GL_MAP1_INDEX", GL_MAP1_INDEX);
-       gpu_get_print("GL_MAP1_NORMAL", GL_MAP1_NORMAL);
-       gpu_get_print("GL_MAP1_TEXTURE_COORD_1", GL_MAP1_TEXTURE_COORD_1);
-       gpu_get_print("GL_MAP1_TEXTURE_COORD_2", GL_MAP1_TEXTURE_COORD_2);
-       gpu_get_print("GL_MAP1_TEXTURE_COORD_3", GL_MAP1_TEXTURE_COORD_3);
-       gpu_get_print("GL_MAP1_TEXTURE_COORD_4", GL_MAP1_TEXTURE_COORD_4);
-       gpu_get_print("GL_MAP1_VERTEX_3", GL_MAP1_VERTEX_3);
-       gpu_get_print("GL_MAP1_VERTEX_4", GL_MAP1_VERTEX_4);
-       gpu_get_print("GL_MAP2_COLOR_4", GL_MAP2_COLOR_4);
-       gpu_get_print("GL_MAP2_GRID_DOMAIN", GL_MAP2_GRID_DOMAIN);
-       gpu_get_print("GL_MAP2_GRID_SEGMENTS", GL_MAP2_GRID_SEGMENTS);
-       gpu_get_print("GL_MAP2_INDEX", GL_MAP2_INDEX);
-       gpu_get_print("GL_MAP2_NORMAL", GL_MAP2_NORMAL);
-       gpu_get_print("GL_MAP2_TEXTURE_COORD_1", GL_MAP2_TEXTURE_COORD_1);
-       gpu_get_print("GL_MAP2_TEXTURE_COORD_2", GL_MAP2_TEXTURE_COORD_2);
-       gpu_get_print("GL_MAP2_TEXTURE_COORD_3", GL_MAP2_TEXTURE_COORD_3);
-       gpu_get_print("GL_MAP2_TEXTURE_COORD_4", GL_MAP2_TEXTURE_COORD_4);
-       gpu_get_print("GL_MAP2_VERTEX_3", GL_MAP2_VERTEX_3);
-       gpu_get_print("GL_MAP2_VERTEX_4", GL_MAP2_VERTEX_4);
-       gpu_get_print("GL_MAP_COLOR", GL_MAP_COLOR);
-       gpu_get_print("GL_MAP_STENCIL", GL_MAP_STENCIL);
-       gpu_get_print("GL_MATRIX_MODE", GL_MATRIX_MODE);
-       gpu_get_print("GL_MAX_3D_TEXTURE_SIZE", GL_MAX_3D_TEXTURE_SIZE);
-       gpu_get_print("GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", GL_MAX_CLIENT_ATTRIB_STACK_DEPTH);
-       gpu_get_print("GL_MAX_ATTRIB_STACK_DEPTH", GL_MAX_ATTRIB_STACK_DEPTH);
-       gpu_get_print("GL_MAX_CLIP_PLANES", GL_MAX_CLIP_PLANES);
-       gpu_get_print("GL_MAX_COLOR_MATRIX_STACK_DEPTH", GL_MAX_COLOR_MATRIX_STACK_DEPTH);
-       gpu_get_print("GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS", GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-       gpu_get_print("GL_MAX_CUBE_MAP_TEXTURE_SIZE", GL_MAX_CUBE_MAP_TEXTURE_SIZE);
-       gpu_get_print("GL_MAX_DRAW_BUFFERS", GL_MAX_DRAW_BUFFERS);
-       gpu_get_print("GL_MAX_ELEMENTS_INDICES", GL_MAX_ELEMENTS_INDICES);
-       gpu_get_print("GL_MAX_ELEMENTS_VERTICES", GL_MAX_ELEMENTS_VERTICES);
-       gpu_get_print("GL_MAX_EVAL_ORDER", GL_MAX_EVAL_ORDER);
-       gpu_get_print("GL_MAX_FRAGMENT_UNIFORM_COMPONENTS", GL_MAX_FRAGMENT_UNIFORM_COMPONENTS);
-       gpu_get_print("GL_MAX_LIGHTS", GL_MAX_LIGHTS);
-       gpu_get_print("GL_MAX_LIST_NESTING", GL_MAX_LIST_NESTING);
-       gpu_get_print("GL_MAX_MODELVIEW_STACK_DEPTH", GL_MAX_MODELVIEW_STACK_DEPTH);
-       gpu_get_print("GL_MAX_NAME_STACK_DEPTH", GL_MAX_NAME_STACK_DEPTH);
-       gpu_get_print("GL_MAX_PIXEL_MAP_TABLE", GL_MAX_PIXEL_MAP_TABLE);
-       gpu_get_print("GL_MAX_PROJECTION_STACK_DEPTH", GL_MAX_PROJECTION_STACK_DEPTH);
-       gpu_get_print("GL_MAX_TEXTURE_COORDS", GL_MAX_TEXTURE_COORDS);
-       gpu_get_print("GL_MAX_TEXTURE_IMAGE_UNITS", GL_MAX_TEXTURE_IMAGE_UNITS);
-       gpu_get_print("GL_MAX_TEXTURE_LOD_BIAS", GL_MAX_TEXTURE_LOD_BIAS);
-       gpu_get_print("GL_MAX_TEXTURE_SIZE", GL_MAX_TEXTURE_SIZE);
-       gpu_get_print("GL_MAX_TEXTURE_STACK_DEPTH", GL_MAX_TEXTURE_STACK_DEPTH);
-       gpu_get_print("GL_MAX_TEXTURE_UNITS", GL_MAX_TEXTURE_UNITS);
-       gpu_get_print("GL_MAX_VARYING_FLOATS", GL_MAX_VARYING_FLOATS);
-       gpu_get_print("GL_MAX_VERTEX_ATTRIBS", GL_MAX_VERTEX_ATTRIBS);
-       gpu_get_print("GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS", GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS);
-       gpu_get_print("GL_MAX_VERTEX_UNIFORM_COMPONENTS", GL_MAX_VERTEX_UNIFORM_COMPONENTS);
-       gpu_get_print("GL_MAX_VIEWPORT_DIMS", GL_MAX_VIEWPORT_DIMS);
-       gpu_get_print("GL_MINMAX", GL_MINMAX);
-       gpu_get_print("GL_MODELVIEW_MATRIX", GL_MODELVIEW_MATRIX);
-       gpu_get_print("GL_MODELVIEW_STACK_DEPTH", GL_MODELVIEW_STACK_DEPTH);
-       gpu_get_print("GL_NAME_STACK_DEPTH", GL_NAME_STACK_DEPTH);
-       gpu_get_print("GL_NORMAL_ARRAY", GL_NORMAL_ARRAY);
-       gpu_get_print("GL_NORMAL_ARRAY_BUFFER_BINDING", GL_NORMAL_ARRAY_BUFFER_BINDING);
-       gpu_get_print("GL_NORMAL_ARRAY_STRIDE", GL_NORMAL_ARRAY_STRIDE);
-       gpu_get_print("GL_NORMAL_ARRAY_TYPE", GL_NORMAL_ARRAY_TYPE);
-       gpu_get_print("GL_NORMALIZE", GL_NORMALIZE);
-       gpu_get_print("GL_NUM_COMPRESSED_TEXTURE_FORMATS", GL_NUM_COMPRESSED_TEXTURE_FORMATS);
-       gpu_get_print("GL_PACK_ALIGNMENT", GL_PACK_ALIGNMENT);
-       gpu_get_print("GL_PACK_IMAGE_HEIGHT", GL_PACK_IMAGE_HEIGHT);
-       gpu_get_print("GL_PACK_LSB_FIRST", GL_PACK_LSB_FIRST);
-       gpu_get_print("GL_PACK_ROW_LENGTH", GL_PACK_ROW_LENGTH);
-       gpu_get_print("GL_PACK_SKIP_IMAGES", GL_PACK_SKIP_IMAGES);
-       gpu_get_print("GL_PACK_SKIP_PIXELS", GL_PACK_SKIP_PIXELS);
-       gpu_get_print("GL_PACK_SKIP_ROWS", GL_PACK_SKIP_ROWS);
-       gpu_get_print("GL_PACK_SWAP_BYTES", GL_PACK_SWAP_BYTES);
-       gpu_get_print("GL_PERSPECTIVE_CORRECTION_HINT", GL_PERSPECTIVE_CORRECTION_HINT);
-       gpu_get_print("GL_PIXEL_MAP_A_TO_A_SIZE", GL_PIXEL_MAP_A_TO_A_SIZE);
-       gpu_get_print("GL_PIXEL_MAP_B_TO_B_SIZE", GL_PIXEL_MAP_B_TO_B_SIZE);
-       gpu_get_print("GL_PIXEL_MAP_G_TO_G_SIZE", GL_PIXEL_MAP_G_TO_G_SIZE);
-       gpu_get_print("GL_PIXEL_MAP_I_TO_A_SIZE", GL_PIXEL_MAP_I_TO_A_SIZE);
-       gpu_get_print("GL_PIXEL_MAP_I_TO_B_SIZE", GL_PIXEL_MAP_I_TO_B_SIZE);
-       gpu_get_print("GL_PIXEL_MAP_I_TO_G_SIZE", GL_PIXEL_MAP_I_TO_G_SIZE);
-       gpu_get_print("GL_PIXEL_MAP_I_TO_I_SIZE", GL_PIXEL_MAP_I_TO_I_SIZE);
-       gpu_get_print("GL_PIXEL_MAP_I_TO_R_SIZE", GL_PIXEL_MAP_I_TO_R_SIZE);
-       gpu_get_print("GL_PIXEL_MAP_R_TO_R_SIZE", GL_PIXEL_MAP_R_TO_R_SIZE);
-       gpu_get_print("GL_PIXEL_MAP_S_TO_S_SIZE", GL_PIXEL_MAP_S_TO_S_SIZE);
-       gpu_get_print("GL_PIXEL_PACK_BUFFER_BINDING", GL_PIXEL_PACK_BUFFER_BINDING);
-       gpu_get_print("GL_PIXEL_UNPACK_BUFFER_BINDING", GL_PIXEL_UNPACK_BUFFER_BINDING);
-       gpu_get_print("GL_POINT_DISTANCE_ATTENUATION", GL_POINT_DISTANCE_ATTENUATION);
-       gpu_get_print("GL_POINT_FADE_THRESHOLD_SIZE", GL_POINT_FADE_THRESHOLD_SIZE);
-       gpu_get_print("GL_POINT_SIZE", GL_POINT_SIZE);
-       gpu_get_print("GL_POINT_SIZE_GRANULARITY", GL_POINT_SIZE_GRANULARITY);
-       gpu_get_print("GL_POINT_SIZE_MAX", GL_POINT_SIZE_MAX);
-       gpu_get_print("GL_POINT_SIZE_MIN", GL_POINT_SIZE_MIN);
-       gpu_get_print("GL_POINT_SIZE_RANGE", GL_POINT_SIZE_RANGE);
-       gpu_get_print("GL_POINT_SMOOTH", GL_POINT_SMOOTH);
-       gpu_get_print("GL_POINT_SMOOTH_HINT", GL_POINT_SMOOTH_HINT);
-       gpu_get_print("GL_POINT_SPRITE", GL_POINT_SPRITE);
-       gpu_get_print("GL_POLYGON_MODE", GL_POLYGON_MODE);
-       gpu_get_print("GL_POLYGON_OFFSET_FACTOR", GL_POLYGON_OFFSET_FACTOR);
-       gpu_get_print("GL_POLYGON_OFFSET_UNITS", GL_POLYGON_OFFSET_UNITS);
-       gpu_get_print("GL_POLYGON_OFFSET_FILL", GL_POLYGON_OFFSET_FILL);
-       gpu_get_print("GL_POLYGON_OFFSET_LINE", GL_POLYGON_OFFSET_LINE);
-       gpu_get_print("GL_POLYGON_OFFSET_POINT", GL_POLYGON_OFFSET_POINT);
-       gpu_get_print("GL_POLYGON_SMOOTH", GL_POLYGON_SMOOTH);
-       gpu_get_print("GL_POLYGON_SMOOTH_HINT", GL_POLYGON_SMOOTH_HINT);
-       gpu_get_print("GL_POLYGON_STIPPLE", GL_POLYGON_STIPPLE);
-       gpu_get_print("GL_POST_COLOR_MATRIX_COLOR_TABLE", GL_POST_COLOR_MATRIX_COLOR_TABLE);
-       gpu_get_print("GL_POST_COLOR_MATRIX_RED_BIAS", GL_POST_COLOR_MATRIX_RED_BIAS);
-       gpu_get_print("GL_POST_COLOR_MATRIX_GREEN_BIAS", GL_POST_COLOR_MATRIX_GREEN_BIAS);
-       gpu_get_print("GL_POST_COLOR_MATRIX_BLUE_BIAS", GL_POST_COLOR_MATRIX_BLUE_BIAS);
-       gpu_get_print("GL_POST_COLOR_MATRIX_ALPHA_BIAS", GL_POST_COLOR_MATRIX_ALPHA_BIAS);
-       gpu_get_print("GL_POST_COLOR_MATRIX_RED_SCALE", GL_POST_COLOR_MATRIX_RED_SCALE);
-       gpu_get_print("GL_POST_COLOR_MATRIX_GREEN_SCALE", GL_POST_COLOR_MATRIX_GREEN_SCALE);
-       gpu_get_print("GL_POST_COLOR_MATRIX_BLUE_SCALE", GL_POST_COLOR_MATRIX_BLUE_SCALE);
-       gpu_get_print("GL_POST_COLOR_MATRIX_ALPHA_SCALE", GL_POST_COLOR_MATRIX_ALPHA_SCALE);
-       gpu_get_print("GL_POST_CONVOLUTION_COLOR_TABLE", GL_POST_CONVOLUTION_COLOR_TABLE);
-       gpu_get_print("GL_POST_CONVOLUTION_RED_BIAS", GL_POST_CONVOLUTION_RED_BIAS);
-       gpu_get_print("GL_POST_CONVOLUTION_GREEN_BIAS", GL_POST_CONVOLUTION_GREEN_BIAS);
-       gpu_get_print("GL_POST_CONVOLUTION_BLUE_BIAS", GL_POST_CONVOLUTION_BLUE_BIAS);
-       gpu_get_print("GL_POST_CONVOLUTION_ALPHA_BIAS", GL_POST_CONVOLUTION_ALPHA_BIAS);
-       gpu_get_print("GL_POST_CONVOLUTION_RED_SCALE", GL_POST_CONVOLUTION_RED_SCALE);
-       gpu_get_print("GL_POST_CONVOLUTION_GREEN_SCALE", GL_POST_CONVOLUTION_GREEN_SCALE);
-       gpu_get_print("GL_POST_CONVOLUTION_BLUE_SCALE", GL_POST_CONVOLUTION_BLUE_SCALE);
-       gpu_get_print("GL_POST_CONVOLUTION_ALPHA_SCALE", GL_POST_CONVOLUTION_ALPHA_SCALE);
-       gpu_get_print("GL_PROJECTION_MATRIX", GL_PROJECTION_MATRIX);
-       gpu_get_print("GL_PROJECTION_STACK_DEPTH", GL_PROJECTION_STACK_DEPTH);
-       gpu_get_print("GL_READ_BUFFER", GL_READ_BUFFER);
-       gpu_get_print("GL_RED_BIAS", GL_RED_BIAS);
-       gpu_get_print("GL_RED_BITS", GL_RED_BITS);
-       gpu_get_print("GL_RED_SCALE", GL_RED_SCALE);
-       gpu_get_print("GL_RENDER_MODE", GL_RENDER_MODE);
-       gpu_get_print("GL_RESCALE_NORMAL", GL_RESCALE_NORMAL);
-       gpu_get_print("GL_RGBA_MODE", GL_RGBA_MODE);
-       gpu_get_print("GL_SAMPLE_BUFFERS", GL_SAMPLE_BUFFERS);
-       gpu_get_print("GL_SAMPLE_COVERAGE_VALUE", GL_SAMPLE_COVERAGE_VALUE);
-       gpu_get_print("GL_SAMPLE_COVERAGE_INVERT", GL_SAMPLE_COVERAGE_INVERT);
-       gpu_get_print("GL_SAMPLES", GL_SAMPLES);
-       gpu_get_print("GL_SCISSOR_BOX", GL_SCISSOR_BOX);
-       gpu_get_print("GL_SCISSOR_TEST", GL_SCISSOR_TEST);
-       gpu_get_print("GL_SECONDARY_COLOR_ARRAY", GL_SECONDARY_COLOR_ARRAY);
-       gpu_get_print("GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING", GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING);
-       gpu_get_print("GL_SECONDARY_COLOR_ARRAY_SIZE", GL_SECONDARY_COLOR_ARRAY_SIZE);
-       gpu_get_print("GL_SECONDARY_COLOR_ARRAY_STRIDE", GL_SECONDARY_COLOR_ARRAY_STRIDE);
-       gpu_get_print("GL_SECONDARY_COLOR_ARRAY_TYPE", GL_SECONDARY_COLOR_ARRAY_TYPE);
-       gpu_get_print("GL_SELECTION_BUFFER_SIZE", GL_SELECTION_BUFFER_SIZE);
-       gpu_get_print("GL_SEPARABLE_2D", GL_SEPARABLE_2D);
-       gpu_get_print("GL_SHADE_MODEL", GL_SHADE_MODEL);
-       gpu_get_print("GL_SMOOTH_LINE_WIDTH_RANGE", GL_SMOOTH_LINE_WIDTH_RANGE);
-       gpu_get_print("GL_SMOOTH_LINE_WIDTH_GRANULARITY", GL_SMOOTH_LINE_WIDTH_GRANULARITY);
-       gpu_get_print("GL_SMOOTH_POINT_SIZE_RANGE", GL_SMOOTH_POINT_SIZE_RANGE);
-       gpu_get_print("GL_SMOOTH_POINT_SIZE_GRANULARITY", GL_SMOOTH_POINT_SIZE_GRANULARITY);
-       gpu_get_print("GL_STENCIL_BACK_FAIL", GL_STENCIL_BACK_FAIL);
-       gpu_get_print("GL_STENCIL_BACK_FUNC", GL_STENCIL_BACK_FUNC);
-       gpu_get_print("GL_STENCIL_BACK_PASS_DEPTH_FAIL", GL_STENCIL_BACK_PASS_DEPTH_FAIL);
-       gpu_get_print("GL_STENCIL_BACK_PASS_DEPTH_PASS", GL_STENCIL_BACK_PASS_DEPTH_PASS);
-       gpu_get_print("GL_STENCIL_BACK_REF", GL_STENCIL_BACK_REF);
-       gpu_get_print("GL_STENCIL_BACK_VALUE_MASK", GL_STENCIL_BACK_VALUE_MASK);
-       gpu_get_print("GL_STENCIL_BACK_WRITEMASK", GL_STENCIL_BACK_WRITEMASK);
-       gpu_get_print("GL_STENCIL_BITS", GL_STENCIL_BITS);
-       gpu_get_print("GL_STENCIL_CLEAR_VALUE", GL_STENCIL_CLEAR_VALUE);
-       gpu_get_print("GL_STENCIL_FAIL", GL_STENCIL_FAIL);
-       gpu_get_print("GL_STENCIL_FUNC", GL_STENCIL_FUNC);
-       gpu_get_print("GL_STENCIL_PASS_DEPTH_FAIL", GL_STENCIL_PASS_DEPTH_FAIL);
-       gpu_get_print("GL_STENCIL_PASS_DEPTH_PASS", GL_STENCIL_PASS_DEPTH_PASS);
-       gpu_get_print("GL_STENCIL_REF", GL_STENCIL_REF);
-       gpu_get_print("GL_STENCIL_TEST", GL_STENCIL_TEST);
-       gpu_get_print("GL_STENCIL_VALUE_MASK", GL_STENCIL_VALUE_MASK);
-       gpu_get_print("GL_STENCIL_WRITEMASK", GL_STENCIL_WRITEMASK);
-       gpu_get_print("GL_STEREO", GL_STEREO);
-       gpu_get_print("GL_SUBPIXEL_BITS", GL_SUBPIXEL_BITS);
-       gpu_get_print("GL_TEXTURE_1D", GL_TEXTURE_1D);
-       gpu_get_print("GL_TEXTURE_BINDING_1D", GL_TEXTURE_BINDING_1D);
-       gpu_get_print("GL_TEXTURE_2D", GL_TEXTURE_2D);
-       gpu_get_print("GL_TEXTURE_BINDING_2D", GL_TEXTURE_BINDING_2D);
-       gpu_get_print("GL_TEXTURE_3D", GL_TEXTURE_3D);
-       gpu_get_print("GL_TEXTURE_BINDING_3D", GL_TEXTURE_BINDING_3D);
-       gpu_get_print("GL_TEXTURE_BINDING_CUBE_MAP", GL_TEXTURE_BINDING_CUBE_MAP);
-       gpu_get_print("GL_TEXTURE_COMPRESSION_HINT", GL_TEXTURE_COMPRESSION_HINT);
-       gpu_get_print("GL_TEXTURE_COORD_ARRAY", GL_TEXTURE_COORD_ARRAY);
-       gpu_get_print("GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING", GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING);
-       gpu_get_print("GL_TEXTURE_COORD_ARRAY_SIZE", GL_TEXTURE_COORD_ARRAY_SIZE);
-       gpu_get_print("GL_TEXTURE_COORD_ARRAY_STRIDE", GL_TEXTURE_COORD_ARRAY_STRIDE);
-       gpu_get_print("GL_TEXTURE_COORD_ARRAY_TYPE", GL_TEXTURE_COORD_ARRAY_TYPE);
-       gpu_get_print("GL_TEXTURE_CUBE_MAP", GL_TEXTURE_CUBE_MAP);
-       gpu_get_print("GL_TEXTURE_GEN_Q", GL_TEXTURE_GEN_Q);
-       gpu_get_print("GL_TEXTURE_GEN_R", GL_TEXTURE_GEN_R);
-       gpu_get_print("GL_TEXTURE_GEN_S", GL_TEXTURE_GEN_S);
-       gpu_get_print("GL_TEXTURE_GEN_T", GL_TEXTURE_GEN_T);
-       gpu_get_print("GL_TEXTURE_MATRIX", GL_TEXTURE_MATRIX);
-       gpu_get_print("GL_TEXTURE_STACK_DEPTH", GL_TEXTURE_STACK_DEPTH);
-       gpu_get_print("GL_TRANSPOSE_COLOR_MATRIX", GL_TRANSPOSE_COLOR_MATRIX);
-       gpu_get_print("GL_TRANSPOSE_MODELVIEW_MATRIX", GL_TRANSPOSE_MODELVIEW_MATRIX);
-       gpu_get_print("GL_TRANSPOSE_PROJECTION_MATRIX", GL_TRANSPOSE_PROJECTION_MATRIX);
-       gpu_get_print("GL_TRANSPOSE_TEXTURE_MATRIX", GL_TRANSPOSE_TEXTURE_MATRIX);
-       gpu_get_print("GL_UNPACK_ALIGNMENT", GL_UNPACK_ALIGNMENT);
-       gpu_get_print("GL_UNPACK_IMAGE_HEIGHT", GL_UNPACK_IMAGE_HEIGHT);
-       gpu_get_print("GL_UNPACK_LSB_FIRST", GL_UNPACK_LSB_FIRST);
-       gpu_get_print("GL_UNPACK_ROW_LENGTH", GL_UNPACK_ROW_LENGTH);
-       gpu_get_print("GL_UNPACK_SKIP_IMAGES", GL_UNPACK_SKIP_IMAGES);
-       gpu_get_print("GL_UNPACK_SKIP_PIXELS", GL_UNPACK_SKIP_PIXELS);
-       gpu_get_print("GL_UNPACK_SKIP_ROWS", GL_UNPACK_SKIP_ROWS);
-       gpu_get_print("GL_UNPACK_SWAP_BYTES", GL_UNPACK_SWAP_BYTES);
-       gpu_get_print("GL_VERTEX_ARRAY", GL_VERTEX_ARRAY);
-       gpu_get_print("GL_VERTEX_ARRAY_BUFFER_BINDING", GL_VERTEX_ARRAY_BUFFER_BINDING);
-       gpu_get_print("GL_VERTEX_ARRAY_SIZE", GL_VERTEX_ARRAY_SIZE);
-       gpu_get_print("GL_VERTEX_ARRAY_STRIDE", GL_VERTEX_ARRAY_STRIDE);
-       gpu_get_print("GL_VERTEX_ARRAY_TYPE", GL_VERTEX_ARRAY_TYPE);
-       gpu_get_print("GL_VERTEX_PROGRAM_POINT_SIZE", GL_VERTEX_PROGRAM_POINT_SIZE);
-       gpu_get_print("GL_VERTEX_PROGRAM_TWO_SIDE", GL_VERTEX_PROGRAM_TWO_SIDE);
-       gpu_get_print("GL_VIEWPORT", GL_VIEWPORT);
-       gpu_get_print("GL_ZOOM_X", GL_ZOOM_X);
-       gpu_get_print("GL_ZOOM_Y", GL_ZOOM_Y);
+       gpu_state_print_fl(GL_ACCUM_ALPHA_BITS);
+       gpu_state_print_fl(GL_ACCUM_BLUE_BITS);
+       gpu_state_print_fl(GL_ACCUM_CLEAR_VALUE);
+       gpu_state_print_fl(GL_ACCUM_GREEN_BITS);
+       gpu_state_print_fl(GL_ACCUM_RED_BITS);
+       gpu_state_print_fl(GL_ACTIVE_TEXTURE);
+       gpu_state_print_fl(GL_ALIASED_LINE_WIDTH_RANGE);
+       gpu_state_print_fl(GL_ALIASED_POINT_SIZE_RANGE);
+       gpu_state_print_fl(GL_ALPHA_BIAS);
+       gpu_state_print_fl(GL_ALPHA_BITS);
+       gpu_state_print_fl(GL_ALPHA_SCALE);
+       gpu_state_print_fl(GL_ALPHA_TEST);
+       gpu_state_print_fl(GL_ALPHA_TEST_FUNC);
+       gpu_state_print_fl(GL_ALPHA_TEST_REF);
+       gpu_state_print_fl(GL_ARRAY_BUFFER_BINDING);
+       gpu_state_print_fl(GL_ATTRIB_STACK_DEPTH);
+       gpu_state_print_fl(GL_AUTO_NORMAL);
+       gpu_state_print_fl(GL_AUX_BUFFERS);
+       gpu_state_print_fl(GL_BLEND);
+       gpu_state_print_fl(GL_BLEND_COLOR);
+       gpu_state_print_fl(GL_BLEND_DST_ALPHA);
+       gpu_state_print_fl(GL_BLEND_DST_RGB);
+       gpu_state_print_fl(GL_BLEND_EQUATION_ALPHA);
+       gpu_state_print_fl(GL_BLEND_EQUATION_RGB);
+       gpu_state_print_fl(GL_BLEND_SRC_ALPHA);
+       gpu_state_print_fl(GL_BLEND_SRC_RGB);
+       gpu_state_print_fl(GL_BLUE_BIAS);
+       gpu_state_print_fl(GL_BLUE_BITS);
+       gpu_state_print_fl(GL_BLUE_SCALE);
+       gpu_state_print_fl(GL_CLIENT_ACTIVE_TEXTURE);
+       gpu_state_print_fl(GL_CLIENT_ATTRIB_STACK_DEPTH);
+       gpu_state_print_fl(GL_CLIP_PLANE0);
+       gpu_state_print_fl(GL_COLOR_ARRAY);
+       gpu_state_print_fl(GL_COLOR_ARRAY_BUFFER_BINDING);
+       gpu_state_print_fl(GL_COLOR_ARRAY_SIZE);
+       gpu_state_print_fl(GL_COLOR_ARRAY_STRIDE);
+       gpu_state_print_fl(GL_COLOR_ARRAY_TYPE);
+       gpu_state_print_fl(GL_COLOR_CLEAR_VALUE);
+       gpu_state_print_fl(GL_COLOR_LOGIC_OP);
+       gpu_state_print_fl(GL_COLOR_MATERIAL);
+       gpu_state_print_fl(GL_COLOR_MATERIAL_FACE);
+       gpu_state_print_fl(GL_COLOR_MATERIAL_PARAMETER);
+       gpu_state_print_fl(GL_COLOR_MATRIX);
+       gpu_state_print_fl(GL_COLOR_MATRIX_STACK_DEPTH);
+       gpu_state_print_fl(GL_COLOR_SUM);
+       gpu_state_print_fl(GL_COLOR_TABLE);
+       gpu_state_print_fl(GL_COLOR_WRITEMASK);
+       gpu_state_print_fl(GL_COMPRESSED_TEXTURE_FORMATS);
+       gpu_state_print_fl(GL_CONVOLUTION_1D);
+       gpu_state_print_fl(GL_CONVOLUTION_2D);
+       gpu_state_print_fl(GL_CULL_FACE);
+       gpu_state_print_fl(GL_CULL_FACE_MODE);
+       gpu_state_print_fl(GL_CURRENT_COLOR);
+       gpu_state_print_fl(GL_CURRENT_FOG_COORD);
+       gpu_state_print_fl(GL_CURRENT_INDEX);
+       gpu_state_print_fl(GL_CURRENT_NORMAL);
+       gpu_state_print_fl(GL_CURRENT_PROGRAM);
+       gpu_state_print_fl(GL_CURRENT_RASTER_COLOR);
+       gpu_state_print_fl(GL_CURRENT_RASTER_DISTANCE);
+       gpu_state_print_fl(GL_CURRENT_RASTER_INDEX);
+       gpu_state_print_fl(GL_CURRENT_RASTER_POSITION);
+       gpu_state_print_fl(GL_CURRENT_RASTER_POSITION_VALID);
+       gpu_state_print_fl(GL_CURRENT_RASTER_SECONDARY_COLOR);
+       gpu_state_print_fl(GL_CURRENT_RASTER_TEXTURE_COORDS);
+       gpu_state_print_fl(GL_CURRENT_SECONDARY_COLOR);
+       gpu_state_print_fl(GL_CURRENT_TEXTURE_COORDS);
+       gpu_state_print_fl(GL_DEPTH_BIAS);
+       gpu_state_print_fl(GL_DEPTH_BITS);
+       gpu_state_print_fl(GL_DEPTH_CLEAR_VALUE);
+       gpu_state_print_fl(GL_DEPTH_FUNC);
+       gpu_state_print_fl(GL_DEPTH_RANGE);
+       gpu_state_print_fl(GL_DEPTH_SCALE);
+       gpu_state_print_fl(GL_DEPTH_TEST);
+       gpu_state_print_fl(GL_DEPTH_WRITEMASK);
+       gpu_state_print_fl(GL_DITHER);
+       gpu_state_print_fl(GL_DOUBLEBUFFER);
+       gpu_state_print_fl(GL_DRAW_BUFFER);
+       gpu_state_print_fl(GL_DRAW_BUFFER0);
+       gpu_state_print_fl(GL_EDGE_FLAG);
+       gpu_state_print_fl(GL_EDGE_FLAG_ARRAY);
+       gpu_state_print_fl(GL_EDGE_FLAG_ARRAY_BUFFER_BINDING);
+       gpu_state_print_fl(GL_EDGE_FLAG_ARRAY_STRIDE);
+       gpu_state_print_fl(GL_ELEMENT_ARRAY_BUFFER_BINDING);
+       gpu_state_print_fl(GL_FEEDBACK_BUFFER_SIZE);
+       gpu_state_print_fl(GL_FEEDBACK_BUFFER_TYPE);
+       gpu_state_print_fl(GL_FOG);
+       gpu_state_print_fl(GL_FOG_COLOR);
+       gpu_state_print_fl(GL_FOG_COORD_ARRAY);
+       gpu_state_print_fl(GL_FOG_COORD_ARRAY_BUFFER_BINDING);
+       gpu_state_print_fl(GL_FOG_COORD_ARRAY_STRIDE);
+       gpu_state_print_fl(GL_FOG_COORD_ARRAY_TYPE);
+       gpu_state_print_fl(GL_FOG_COORD_SRC);
+       gpu_state_print_fl(GL_FOG_DENSITY);
+       gpu_state_print_fl(GL_FOG_END);
+       gpu_state_print_fl(GL_FOG_HINT);
+       gpu_state_print_fl(GL_FOG_INDEX);
+       gpu_state_print_fl(GL_FOG_MODE);
+       gpu_state_print_fl(GL_FOG_START);
+       gpu_state_print_fl(GL_FRAGMENT_PROGRAM_ARB);
+       gpu_state_print_fl(GL_FRAGMENT_SHADER_DERIVATIVE_HINT);
+       gpu_state_print_fl(GL_FRONT_FACE);
+       gpu_state_print_fl(GL_GENERATE_MIPMAP_HINT);
+       gpu_state_print_fl(GL_GREEN_BIAS);
+       gpu_state_print_fl(GL_GREEN_BITS);
+       gpu_state_print_fl(GL_GREEN_SCALE);
+       gpu_state_print_fl(GL_HISTOGRAM);
+       gpu_state_print_fl(GL_INDEX_ARRAY);
+       gpu_state_print_fl(GL_INDEX_ARRAY_BUFFER_BINDING);
+       gpu_state_print_fl(GL_INDEX_ARRAY_STRIDE);
+       gpu_state_print_fl(GL_INDEX_ARRAY_TYPE);
+       gpu_state_print_fl(GL_INDEX_BITS);
+       gpu_state_print_fl(GL_INDEX_CLEAR_VALUE);
+       gpu_state_print_fl(GL_INDEX_LOGIC_OP);
+       gpu_state_print_fl(GL_INDEX_MODE);
+       gpu_state_print_fl(GL_INDEX_OFFSET);
+       gpu_state_print_fl(GL_INDEX_SHIFT);
+       gpu_state_print_fl(GL_INDEX_WRITEMASK);
+       gpu_state_print_fl(GL_LIGHT0);
+       gpu_state_print_fl(GL_LIGHT1);
+       gpu_state_print_fl(GL_LIGHT2);
+       gpu_state_print_fl(GL_LIGHT3);
+       gpu_state_print_fl(GL_LIGHT4);
+       gpu_state_print_fl(GL_LIGHT5);
+       gpu_state_print_fl(GL_LIGHT6);
+       gpu_state_print_fl(GL_LIGHT7);
+       gpu_state_print_fl(GL_LIGHTING);
+       gpu_state_print_fl(GL_LIGHT_MODEL_AMBIENT);
+       gpu_state_print_fl(GL_LIGHT_MODEL_COLOR_CONTROL);
+       gpu_state_print_fl(GL_LIGHT_MODEL_LOCAL_VIEWER);
+       gpu_state_print_fl(GL_LIGHT_MODEL_TWO_SIDE);
+       gpu_state_print_fl(GL_LINE_SMOOTH);
+       gpu_state_print_fl(GL_LINE_SMOOTH_HINT);
+       gpu_state_print_fl(GL_LINE_STIPPLE);
+       gpu_state_print_fl(GL_LINE_STIPPLE_PATTERN);
+       gpu_state_print_fl(GL_LINE_STIPPLE_REPEAT);
+       gpu_state_print_fl(GL_LINE_WIDTH);
+       gpu_state_print_fl(GL_LINE_WIDTH_GRANULARITY);
+       gpu_state_print_fl(GL_LINE_WIDTH_RANGE);
+       gpu_state_print_fl(GL_LIST_BASE);
+       gpu_state_print_fl(GL_LIST_INDEX);
+       gpu_state_print_fl(GL_LIST_MODE);
+       gpu_state_print_fl(GL_LOGIC_OP);
+       gpu_state_print_fl(GL_LOGIC_OP_MODE);
+       gpu_state_print_fl(GL_MAP1_COLOR_4);
+       gpu_state_print_fl(GL_MAP1_GRID_DOMAIN);
+       gpu_state_print_fl(GL_MAP1_GRID_SEGMENTS);
+       gpu_state_print_fl(GL_MAP1_INDEX);
+       gpu_state_print_fl(GL_MAP1_NORMAL);
+       gpu_state_print_fl(GL_MAP1_TEXTURE_COORD_1);
+       gpu_state_print_fl(GL_MAP1_TEXTURE_COORD_2);
+       gpu_state_print_fl(GL_MAP1_TEXTURE_COORD_3);
+       gpu_state_print_fl(GL_MAP1_TEXTURE_COORD_4);
+       gpu_state_print_fl(GL_MAP1_VERTEX_3);
+       gpu_state_print_fl(GL_MAP1_VERTEX_4);
+       gpu_state_print_fl(GL_MAP2_COLOR_4);
+       gpu_state_print_fl(GL_MAP2_GRID_DOMAIN);
+       gpu_state_print_fl(GL_MAP2_GRID_SEGMENTS);
+       gpu_state_print_fl(GL_MAP2_INDEX);
+       gpu_state_print_fl(GL_MAP2_NORMAL);
+       gpu_state_print_fl(GL_MAP2_TEXTURE_COORD_1);
+       gpu_state_print_fl(GL_MAP2_TEXTURE_COORD_2);
+       gpu_state_print_fl(GL_MAP2_TEXTURE_COORD_3);
+       gpu_state_print_fl(GL_MAP2_TEXTURE_COORD_4);
+       gpu_state_print_fl(GL_MAP2_VERTEX_3);
+       gpu_state_print_fl(GL_MAP2_VERTEX_4);
+       gpu_state_print_fl(GL_MAP_COLOR);
+       gpu_state_print_fl(GL_MAP_STENCIL);
+       gpu_state_print_fl(GL_MATRIX_MODE);
+       gpu_state_print_fl(GL_MAX_3D_TEXTURE_SIZE);
+       gpu_state_print_fl(GL_MAX_ATTRIB_STACK_DEPTH);
+       gpu_state_print_fl(GL_MAX_CLIENT_ATTRIB_STACK_DEPTH);
+       gpu_state_print_fl(GL_MAX_CLIP_PLANES);
+       gpu_state_print_fl(GL_MAX_COLOR_MATRIX_STACK_DEPTH);
+       gpu_state_print_fl(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+       gpu_state_print_fl(GL_MAX_CUBE_MAP_TEXTURE_SIZE);
+       gpu_state_print_fl(GL_MAX_DRAW_BUFFERS);
+       gpu_state_print_fl(GL_MAX_ELEMENTS_INDICES);
+       gpu_state_print_fl(GL_MAX_ELEMENTS_VERTICES);
+       gpu_state_print_fl(GL_MAX_EVAL_ORDER);
+       gpu_state_print_fl(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS);
+       gpu_state_print_fl(GL_MAX_LIGHTS);
+       gpu_state_print_fl(GL_MAX_LIST_NESTING);
+       gpu_state_print_fl(GL_MAX_MODELVIEW_STACK_DEPTH);
+       gpu_state_print_fl(GL_MAX_NAME_STACK_DEPTH);
+       gpu_state_print_fl(GL_MAX_PIXEL_MAP_TABLE);
+       gpu_state_print_fl(GL_MAX_PROJECTION_STACK_DEPTH);
+       gpu_state_print_fl(GL_MAX_TEXTURE_COORDS);
+       gpu_state_print_fl(GL_MAX_TEXTURE_IMAGE_UNITS);
+       gpu_state_print_fl(GL_MAX_TEXTURE_LOD_BIAS);
+       gpu_state_print_fl(GL_MAX_TEXTURE_SIZE);
+       gpu_state_print_fl(GL_MAX_TEXTURE_STACK_DEPTH);
+       gpu_state_print_fl(GL_MAX_TEXTURE_UNITS);
+       gpu_state_print_fl(GL_MAX_VARYING_FLOATS);
+       gpu_state_print_fl(GL_MAX_VERTEX_ATTRIBS);
+       gpu_state_print_fl(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS);
+       gpu_state_print_fl(GL_MAX_VERTEX_UNIFORM_COMPONENTS);
+       gpu_state_print_fl(GL_MAX_VIEWPORT_DIMS);
+       gpu_state_print_fl(GL_MINMAX);
+       gpu_state_print_fl(GL_MODELVIEW_MATRIX);
+       gpu_state_print_fl(GL_MODELVIEW_STACK_DEPTH);
+       gpu_state_print_fl(GL_MULTISAMPLE);
+       gpu_state_print_fl(GL_MULTISAMPLE_ARB);
+       gpu_state_print_fl(GL_NAME_STACK_DEPTH);
+       gpu_state_print_fl(GL_NORMALIZE);
+       gpu_state_print_fl(GL_NORMAL_ARRAY);
+       gpu_state_print_fl(GL_NORMAL_ARRAY_BUFFER_BINDING);
+       gpu_state_print_fl(GL_NORMAL_ARRAY_STRIDE);
+       gpu_state_print_fl(GL_NORMAL_ARRAY_TYPE);
+       gpu_state_print_fl(GL_NUM_COMPRESSED_TEXTURE_FORMATS);
+       gpu_state_print_fl(GL_PACK_ALIGNMENT);
+       gpu_state_print_fl(GL_PACK_IMAGE_HEIGHT);
+       gpu_state_print_fl(GL_PACK_LSB_FIRST);
+       gpu_state_print_fl(GL_PACK_ROW_LENGTH);
+       gpu_state_print_fl(GL_PACK_SKIP_IMAGES);
+       gpu_state_print_fl(GL_PACK_SKIP_PIXELS);
+       gpu_state_print_fl(GL_PACK_SKIP_ROWS);
+       gpu_state_print_fl(GL_PACK_SWAP_BYTES);
+       gpu_state_print_fl(GL_PERSPECTIVE_CORRECTION_HINT);
+       gpu_state_print_fl(GL_PIXEL_MAP_A_TO_A_SIZE);
+       gpu_state_print_fl(GL_PIXEL_MAP_B_TO_B_SIZE);
+       gpu_state_print_fl(GL_PIXEL_MAP_G_TO_G_SIZE);
+       gpu_state_print_fl(GL_PIXEL_MAP_I_TO_A_SIZE);
+       gpu_state_print_fl(GL_PIXEL_MAP_I_TO_B_SIZE);
+       gpu_state_print_fl(GL_PIXEL_MAP_I_TO_G_SIZE);
+       gpu_state_print_fl(GL_PIXEL_MAP_I_TO_I_SIZE);
+       gpu_state_print_fl(GL_PIXEL_MAP_I_TO_R_SIZE);
+       gpu_state_print_fl(GL_PIXEL_MAP_R_TO_R_SIZE);
+       gpu_state_print_fl(GL_PIXEL_MAP_S_TO_S_SIZE);
+       gpu_state_print_fl(GL_PIXEL_PACK_BUFFER_BINDING);
+       gpu_state_print_fl(GL_PIXEL_UNPACK_BUFFER_BINDING);
+       gpu_state_print_fl(GL_POINT_DISTANCE_ATTENUATION);
+       gpu_state_print_fl(GL_POINT_FADE_THRESHOLD_SIZE);
+       gpu_state_print_fl(GL_POINT_SIZE);
+       gpu_state_print_fl(GL_POINT_SIZE_GRANULARITY);
+       gpu_state_print_fl(GL_POINT_SIZE_MAX);
+       gpu_state_print_fl(GL_POINT_SIZE_MIN);
+       gpu_state_print_fl(GL_POINT_SIZE_RANGE);
+       gpu_state_print_fl(GL_POINT_SMOOTH);
+       gpu_state_print_fl(GL_POINT_SMOOTH_HINT);
+       gpu_state_print_fl(GL_POINT_SPRITE);
+       gpu_state_print_fl(GL_POLYGON_MODE);
+       gpu_state_print_fl(GL_POLYGON_OFFSET_FACTOR);
+       gpu_state_print_fl(GL_POLYGON_OFFSET_FILL);
+       gpu_state_print_fl(GL_POLYGON_OFFSET_LINE);
+       gpu_state_print_fl(GL_POLYGON_OFFSET_POINT);
+       gpu_state_print_fl(GL_POLYGON_OFFSET_UNITS);
+       gpu_state_print_fl(GL_POLYGON_SMOOTH);
+       gpu_state_print_fl(GL_POLYGON_SMOOTH_HINT);
+       gpu_state_print_fl(GL_POLYGON_STIPPLE);
+       gpu_state_print_fl(GL_POST_COLOR_MATRIX_ALPHA_BIAS);
+       gpu_state_print_fl(GL_POST_COLOR_MATRIX_ALPHA_SCALE);
+       gpu_state_print_fl(GL_POST_COLOR_MATRIX_BLUE_BIAS);
+       gpu_state_print_fl(GL_POST_COLOR_MATRIX_BLUE_SCALE);
+       gpu_state_print_fl(GL_POST_COLOR_MATRIX_COLOR_TABLE);
+       gpu_state_print_fl(GL_POST_COLOR_MATRIX_GREEN_BIAS);
+       gpu_state_print_fl(GL_POST_COLOR_MATRIX_GREEN_SCALE);
+       gpu_state_print_fl(GL_POST_COLOR_MATRIX_RED_BIAS);
+       gpu_state_print_fl(GL_POST_COLOR_MATRIX_RED_SCALE);
+       gpu_state_print_fl(GL_POST_CONVOLUTION_ALPHA_BIAS);
+       gpu_state_print_fl(GL_POST_CONVOLUTION_ALPHA_SCALE);
+       gpu_state_print_fl(GL_POST_CONVOLUTION_BLUE_BIAS);
+       gpu_state_print_fl(GL_POST_CONVOLUTION_BLUE_SCALE);
+       gpu_state_print_fl(GL_POST_CONVOLUTION_COLOR_TABLE);
+       gpu_state_print_fl(GL_POST_CONVOLUTION_GREEN_BIAS);
+       gpu_state_print_fl(GL_POST_CONVOLUTION_GREEN_SCALE);
+       gpu_state_print_fl(GL_POST_CONVOLUTION_RED_BIAS);
+       gpu_state_print_fl(GL_POST_CONVOLUTION_RED_SCALE);
+       gpu_state_print_fl(GL_PROJECTION_MATRIX);
+       gpu_state_print_fl(GL_PROJECTION_STACK_DEPTH);
+       gpu_state_print_fl(GL_READ_BUFFER);
+       gpu_state_print_fl(GL_RED_BIAS);
+       gpu_state_print_fl(GL_RED_BITS);
+       gpu_state_print_fl(GL_RED_SCALE);
+       gpu_state_print_fl(GL_RENDER_MODE);
+       gpu_state_print_fl(GL_RESCALE_NORMAL);
+       gpu_state_print_fl(GL_RGBA_MODE);
+       gpu_state_print_fl(GL_SAMPLES);
+       gpu_state_print_fl(GL_SAMPLE_BUFFERS);
+       gpu_state_print_fl(GL_SAMPLE_COVERAGE_INVERT);
+       gpu_state_print_fl(GL_SAMPLE_COVERAGE_VALUE);
+       gpu_state_print_fl(GL_SCISSOR_BOX);
+       gpu_state_print_fl(GL_SCISSOR_TEST);
+       gpu_state_print_fl(GL_SECONDARY_COLOR_ARRAY);
+       gpu_state_print_fl(GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING);
+       gpu_state_print_fl(GL_SECONDARY_COLOR_ARRAY_SIZE);
+       gpu_state_print_fl(GL_SECONDARY_COLOR_ARRAY_STRIDE);
+       gpu_state_print_fl(GL_SECONDARY_COLOR_ARRAY_TYPE);
+       gpu_state_print_fl(GL_SELECTION_BUFFER_SIZE);
+       gpu_state_print_fl(GL_SEPARABLE_2D);
+       gpu_state_print_fl(GL_SHADE_MODEL);
+       gpu_state_print_fl(GL_SMOOTH_LINE_WIDTH_GRANULARITY);
+       gpu_state_print_fl(GL_SMOOTH_LINE_WIDTH_RANGE);
+       gpu_state_print_fl(GL_SMOOTH_POINT_SIZE_GRANULARITY);
+       gpu_state_print_fl(GL_SMOOTH_POINT_SIZE_RANGE);
+       gpu_state_print_fl(GL_STENCIL_BACK_FAIL);
+       gpu_state_print_fl(GL_STENCIL_BACK_FUNC);
+       gpu_state_print_fl(GL_STENCIL_BACK_PASS_DEPTH_FAIL);
+       gpu_state_print_fl(GL_STENCIL_BACK_PASS_DEPTH_PASS);
+       gpu_state_print_fl(GL_STENCIL_BACK_REF);
+       gpu_state_print_fl(GL_STENCIL_BACK_VALUE_MASK);
+       gpu_state_print_fl(GL_STENCIL_BACK_WRITEMASK);
+       gpu_state_print_fl(GL_STENCIL_BITS);
+       gpu_state_print_fl(GL_STENCIL_CLEAR_VALUE);
+       gpu_state_print_fl(GL_STENCIL_FAIL);
+       gpu_state_print_fl(GL_STENCIL_FUNC);
+       gpu_state_print_fl(GL_STENCIL_PASS_DEPTH_FAIL);
+       gpu_state_print_fl(GL_STENCIL_PASS_DEPTH_PASS);
+       gpu_state_print_fl(GL_STENCIL_REF);
+       gpu_state_print_fl(GL_STENCIL_TEST);
+       gpu_state_print_fl(GL_STENCIL_VALUE_MASK);
+       gpu_state_print_fl(GL_STENCIL_WRITEMASK);
+       gpu_state_print_fl(GL_STEREO);
+       gpu_state_print_fl(GL_SUBPIXEL_BITS);
+       gpu_state_print_fl(GL_TEXTURE_1D);
+       gpu_state_print_fl(GL_TEXTURE_2D);
+       gpu_state_print_fl(GL_TEXTURE_3D);
+       gpu_state_print_fl(GL_TEXTURE_BINDING_1D);
+       gpu_state_print_fl(GL_TEXTURE_BINDING_2D);
+       gpu_state_print_fl(GL_TEXTURE_BINDING_3D);
+       gpu_state_print_fl(GL_TEXTURE_BINDING_CUBE_MAP);
+       gpu_state_print_fl(GL_TEXTURE_COMPRESSION_HINT);
+       gpu_state_print_fl(GL_TEXTURE_COORD_ARRAY);
+       gpu_state_print_fl(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING);
+       gpu_state_print_fl(GL_TEXTURE_COORD_ARRAY_SIZE);
+       gpu_state_print_fl(GL_TEXTURE_COORD_ARRAY_STRIDE);
+       gpu_state_print_fl(GL_TEXTURE_COORD_ARRAY_TYPE);
+       gpu_state_print_fl(GL_TEXTURE_CUBE_MAP);
+       gpu_state_print_fl(GL_TEXTURE_CUBE_MAP_ARB);
+       gpu_state_print_fl(GL_TEXTURE_GEN_Q);
+       gpu_state_print_fl(GL_TEXTURE_GEN_R);
+       gpu_state_print_fl(GL_TEXTURE_GEN_S);
+       gpu_state_print_fl(GL_TEXTURE_GEN_T);
+       gpu_state_print_fl(GL_TEXTURE_MATRIX);
+       gpu_state_print_fl(GL_TEXTURE_STACK_DEPTH);
+       gpu_state_print_fl(GL_TRANSPOSE_COLOR_MATRIX);
+       gpu_state_print_fl(GL_TRANSPOSE_MODELVIEW_MATRIX);
+       gpu_state_print_fl(GL_TRANSPOSE_PROJECTION_MATRIX);
+       gpu_state_print_fl(GL_TRANSPOSE_TEXTURE_MATRIX);
+       gpu_state_print_fl(GL_UNPACK_ALIGNMENT);
+       gpu_state_print_fl(GL_UNPACK_IMAGE_HEIGHT);
+       gpu_state_print_fl(GL_UNPACK_LSB_FIRST);
+       gpu_state_print_fl(GL_UNPACK_ROW_LENGTH);
+       gpu_state_print_fl(GL_UNPACK_SKIP_IMAGES);
+       gpu_state_print_fl(GL_UNPACK_SKIP_PIXELS);
+       gpu_state_print_fl(GL_UNPACK_SKIP_ROWS);
+       gpu_state_print_fl(GL_UNPACK_SWAP_BYTES);
+       gpu_state_print_fl(GL_VERTEX_ARRAY);
+       gpu_state_print_fl(GL_VERTEX_ARRAY_BUFFER_BINDING);
+       gpu_state_print_fl(GL_VERTEX_ARRAY_SIZE);
+       gpu_state_print_fl(GL_VERTEX_ARRAY_STRIDE);
+       gpu_state_print_fl(GL_VERTEX_ARRAY_TYPE);
+       gpu_state_print_fl(GL_VERTEX_PROGRAM_POINT_SIZE);
+       gpu_state_print_fl(GL_VERTEX_PROGRAM_TWO_SIDE);
+       gpu_state_print_fl(GL_VIEWPORT);
+       gpu_state_print_fl(GL_ZOOM_X);
+       gpu_state_print_fl(GL_ZOOM_Y);
 }
+
+#undef gpu_state_print_fl
+
 #endif
index 507d54d75266f0033561916631bf69c21f7abff6..2ca50afb0f2809872b4b8dff610d9da3c437b208 100644 (file)
@@ -86,12 +86,13 @@ static IKPlugin ikplugin_tab[] = {
 
 static IKPlugin *get_plugin(bPose *pose)
 {
-       if (!pose || pose->iksolver < 0 || pose->iksolver > (sizeof(ikplugin_tab) / sizeof(IKPlugin) - 2))
+       if (!pose || pose->iksolver < 0 || pose->iksolver >= ((sizeof(ikplugin_tab) / sizeof(IKPlugin)) - 1))
                return NULL;
 
        return &ikplugin_tab[pose->iksolver];
 }
 
+
 /*----------------------------------------*/
 /* Plugin API                                                    */
 
index fbf64138e4c99e0fd4e10d06fc7ea6a68f7cddba..c1707048612d0c8b17aab3c5419f7f0c10e76ae7 100644 (file)
@@ -667,7 +667,7 @@ static void rna_def_brush(BlenderRNA *brna)
        prop = RNA_def_property(srna, "vertex_tool", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "vertexpaint_tool");
        RNA_def_property_enum_items(prop, brush_vertex_tool_items);
-       RNA_def_property_ui_text(prop, "Vertex/Weight Paint Tool", "");
+       RNA_def_property_ui_text(prop, "Blending mode", "Brush blending mode");
        RNA_def_property_update(prop, 0, "rna_Brush_vertex_tool_update");
        
        prop = RNA_def_property(srna, "image_tool", PROP_ENUM, PROP_NONE);
index b70ab7c15f2a699748733ddede182ca1c319ed49..24eab621f5e85a3cd64b719c7c6d581bae2d8e2f 100644 (file)
@@ -1598,32 +1598,32 @@ static void rna_def_event(BlenderRNA *brna)
        prop = RNA_def_property(srna, "mouse_x", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "x");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-       RNA_def_property_ui_text(prop, "Mouse X Position", "The window relative vertical location of the mouse");
+       RNA_def_property_ui_text(prop, "Mouse X Position", "The window relative horizontal location of the mouse");
        
        prop = RNA_def_property(srna, "mouse_y", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "y");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-       RNA_def_property_ui_text(prop, "Mouse Y Position", "The window relative horizontal location of the mouse");
+       RNA_def_property_ui_text(prop, "Mouse Y Position", "The window relative vertical location of the mouse");
 
        prop = RNA_def_property(srna, "mouse_region_x", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "mval[0]");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-       RNA_def_property_ui_text(prop, "Mouse X Position", "The region relative vertical location of the mouse");
+       RNA_def_property_ui_text(prop, "Mouse X Position", "The region relative horizontal location of the mouse");
 
        prop = RNA_def_property(srna, "mouse_region_y", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "mval[1]");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-       RNA_def_property_ui_text(prop, "Mouse Y Position", "The region relative horizontal location of the mouse");
+       RNA_def_property_ui_text(prop, "Mouse Y Position", "The region relative vertical location of the mouse");
        
        prop = RNA_def_property(srna, "mouse_prev_x", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "prevx");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-       RNA_def_property_ui_text(prop, "Mouse Previous X Position", "The window relative vertical location of the mouse");
+       RNA_def_property_ui_text(prop, "Mouse Previous X Position", "The window relative horizontal location of the mouse");
        
        prop = RNA_def_property(srna, "mouse_prev_y", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "prevy");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-       RNA_def_property_ui_text(prop, "Mouse Previous Y Position", "The window relative horizontal location of the mouse");
+       RNA_def_property_ui_text(prop, "Mouse Previous Y Position", "The window relative vertical location of the mouse");
 
 
        /* modifiers */
@@ -1721,12 +1721,12 @@ static void rna_def_window(BlenderRNA *brna)
        prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "posx");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-       RNA_def_property_ui_text(prop, "X Position", "Vertical location of the window");
+       RNA_def_property_ui_text(prop, "X Position", "Horizontal location of the window");
 
        prop = RNA_def_property(srna, "y", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "posy");
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-       RNA_def_property_ui_text(prop, "Y Position", "Horizontal location of the window");
+       RNA_def_property_ui_text(prop, "Y Position", "Vertical location of the window");
 
        prop = RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
        RNA_def_property_int_sdna(prop, NULL, "sizex");
index a6369aeb3a842fd3cc47d5f25943292cbec0d1d8..ad1e70423a5e360ec821d1250389895761fefbe6 100644 (file)
  *  \ingroup cmpnodes
  */
 
-
-
 #include "node_composite_util.h"
 
 
 /* ******************* Color Balance ********************************* */
 static bNodeSocketTemplate cmp_node_colorcorrection_in[] = {
-       {       SOCK_RGBA,1,N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
+       {       SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
        {       SOCK_FLOAT, 1, N_("Mask"),      1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
-       {       -1,0,""}
+       {       -1, 0, ""}
 };
 
 static bNodeSocketTemplate cmp_node_colorcorrection_out[] = {
-       {       SOCK_RGBA,0,N_("Image")},
-       {       -1,0,""}
+       {       SOCK_RGBA, 0, N_("Image")},
+       {       -1, 0, ""}
 };
 
 static void node_composit_init_colorcorrection(bNodeTree *UNUSED(ntree), bNode *node)
index c96206643d9d2b174b4c29aa57ea39bf997335e0..29555756f9f19b3dd1e5a8eb926adbe34927fb5a 100644 (file)
@@ -4563,7 +4563,7 @@ static int render_object_type(short type)
        return OB_TYPE_SUPPORT_MATERIAL(type);
 }
 
-static void find_dupli_instances(Render *re, ObjectRen *obr)
+static void find_dupli_instances(Render *re, ObjectRen *obr, DupliObject *dob)
 {
        ObjectInstanceRen *obi;
        float imat[4][4], obmat[4][4], obimat[4][4], nmat[3][3];
@@ -4588,6 +4588,12 @@ static void find_dupli_instances(Render *re, ObjectRen *obr)
                        invert_m3_m3(obi->nmat, nmat);
                        transpose_m3(obi->nmat);
 
+                       if (dob) {
+                               copy_v3_v3(obi->dupliorco, dob->orco);
+                               obi->dupliuv[0]= dob->uv[0];
+                               obi->dupliuv[1]= dob->uv[1];
+                       }
+
                        if (!first) {
                                re->totvert += obr->totvert;
                                re->totvlak += obr->totvlak;
@@ -4600,7 +4606,7 @@ static void find_dupli_instances(Render *re, ObjectRen *obr)
        }
 }
 
-static void assign_dupligroup_dupli(Render *re, ObjectInstanceRen *obi, ObjectRen *obr)
+static void assign_dupligroup_dupli(Render *re, ObjectInstanceRen *obi, ObjectRen *obr, DupliObject *dob)
 {
        float imat[4][4], obmat[4][4], obimat[4][4], nmat[3][3];
 
@@ -4618,6 +4624,12 @@ static void assign_dupligroup_dupli(Render *re, ObjectInstanceRen *obi, ObjectRe
        invert_m3_m3(obi->nmat, nmat);
        transpose_m3(obi->nmat);
 
+       if (dob) {
+               copy_v3_v3(obi->dupliorco, dob->orco);
+               obi->dupliuv[0]= dob->uv[0];
+               obi->dupliuv[1]= dob->uv[1];
+       }
+
        re->totvert += obr->totvert;
        re->totvlak += obr->totvlak;
        re->tothalo += obr->tothalo;
@@ -4682,6 +4694,12 @@ static void set_dupli_tex_mat(Render *re, ObjectInstanceRen *obi, DupliObject *d
                invert_m4_m4(imat, dob->mat);
                mul_serie_m4(obi->duplitexmat, re->viewmat, dob->omat, imat, re->viewinv, 0, 0, 0, 0);
        }
+
+       if (dob) {
+               copy_v3_v3(obi->dupliorco, dob->orco);
+               obi->dupliuv[0]= dob->uv[0];
+               obi->dupliuv[1]= dob->uv[1];
+       }
 }
 
 static void init_render_object_data(Render *re, ObjectRen *obr, int timeoffset)
@@ -4765,7 +4783,7 @@ static void add_render_object(Render *re, Object *ob, Object *par, DupliObject *
                        if (dob) set_dupli_tex_mat(re, obi, dob);
                }
                else
-                       find_dupli_instances(re, obr);
+                       find_dupli_instances(re, obr, dob);
                        
                for (i=1; i<=ob->totcol; i++) {
                        Material* ma = give_render_material(re, ob, i);
@@ -4796,7 +4814,7 @@ static void add_render_object(Render *re, Object *ob, Object *par, DupliObject *
                                if (dob) set_dupli_tex_mat(re, obi, dob);
                        }
                        else
-                               find_dupli_instances(re, obr);
+                               find_dupli_instances(re, obr, dob);
                }
        }
 }
@@ -5154,9 +5172,9 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
                                                                 * created object, and possibly setup instances if this object
                                                                 * itself was duplicated. for the first case find_dupli_instances
                                                                 * will be called later. */
-                                                               assign_dupligroup_dupli(re, obi, obr);
+                                                               assign_dupligroup_dupli(re, obi, obr, dob);
                                                                if (obd->transflag & OB_RENDER_DUPLI)
-                                                                       find_dupli_instances(re, obr);
+                                                                       find_dupli_instances(re, obr, dob);
                                                        }
                                                }
 
@@ -5176,9 +5194,9 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
                                                                        obi->dupliuv[1]= dob->uv[1];
                                                                }
                                                                else {
-                                                                       assign_dupligroup_dupli(re, obi, obr);
+                                                                       assign_dupligroup_dupli(re, obi, obr, dob);
                                                                        if (obd->transflag & OB_RENDER_DUPLI)
-                                                                               find_dupli_instances(re, obr);
+                                                                               find_dupli_instances(re, obr, dob);
                                                                }
                                                        }
                                                }
index 3eeaebff92d0f2d8dff501b3c552b91cebcb516d..178d304eca21130fee2e116fa0554901c0e0b393 100644 (file)
@@ -924,6 +924,19 @@ void shade_color(ShadeInput *shi, ShadeResult *shr)
        shr->diff[1]= shi->g;
        shr->diff[2]= shi->b;
        shr->alpha= shi->alpha;
+
+       /* modulate by the object color */
+       if ((ma->shade_flag & MA_OBCOLOR) && shi->obr->ob) {
+               float obcol[4];
+
+               copy_v4_v4(obcol, shi->obr->ob->col);
+               CLAMP(obcol[3], 0.0f, 1.0f);
+
+               shr->diff[0] *= obcol[0];
+               shr->diff[1] *= obcol[1];
+               shr->diff[2] *= obcol[2];
+               if (shi->mode & MA_TRANSP) shr->alpha *= obcol[3];
+       }
 }
 
 /* ramp for at end of shade */
index fa7e4afc68c8d555c20b99be5d00e27fc60ace4f..515f80b0adead7412397557467518f13a11e8afb 100644 (file)
@@ -107,7 +107,9 @@ static BCursor *BlenderCursor[BC_NUMCURSORS]; /*Points to static BCursor Structs
 void WM_cursor_set(wmWindow *win, int curs)
 {
 
-       if (win == NULL) return;  /* Can't set custom cursor before Window init */
+       if (win == NULL || G.background) {
+               return;  /* Can't set custom cursor before Window init */
+       }
 
        if (curs == CURSOR_NONE) {
                GHOST_SetCursorVisibility(win->ghostwin, 0);
index df5de47fb3bdb33d211b529530a0c6a619b9dd1a..b9455601ede4e76db1fbbbde716f3ca8e342970e 100644 (file)
@@ -1939,7 +1939,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
        if (CTX_wm_window(C) == NULL)
                return action;
 
-       if (!ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) && !ISTIMER(event->type)) {
+       if (!ELEM3(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE, EVENT_NONE) && !ISTIMER(event->type)) {
 
                /* test for CLICK events */
                if (wm_action_not_handled(action)) {
index 0771e6b8f5ae0d249a0ad60c523e23a10e6276e8..42e72f521371545fa47c79f9b6c8a21f6317ccb5 100644 (file)
@@ -1674,7 +1674,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
        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-267");
+                     "http://www.blender.org/development/release-logs/blender-268");
        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");
@@ -3021,7 +3021,7 @@ static void tweak_gesture_modal(bContext *C, const wmEvent *event)
                        }
                        break;
                default:
-                       if (!ISTIMER(event->type)) {
+                       if (!ISTIMER(event->type) && event->type != EVENT_NONE) {
                                WM_gesture_end(C, gesture);
                        }
                        break;
index 04882f07cc30530ff142baaaa835ea8dce759708..84d235308002026f0071e4ee78965d79a7587cbf 100644 (file)
@@ -249,12 +249,12 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data)
        BLI_argsPrintArgDoc(ba, "--frame-jump");
        BLI_argsPrintArgDoc(ba, "--render-output");
        BLI_argsPrintArgDoc(ba, "--engine");
+       BLI_argsPrintArgDoc(ba, "--threads");
        
        printf("\n");
        printf("Format Options:\n");
        BLI_argsPrintArgDoc(ba, "--render-format");
        BLI_argsPrintArgDoc(ba, "--use-extension");
-       BLI_argsPrintArgDoc(ba, "--threads");
 
        printf("\n");
        printf("Animation Playback Options:\n");
@@ -266,26 +266,52 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data)
        BLI_argsPrintArgDoc(ba, "--window-borderless");
        BLI_argsPrintArgDoc(ba, "--window-geometry");
        BLI_argsPrintArgDoc(ba, "--start-console");
+       BLI_argsPrintArgDoc(ba, "--no-native-pixels");
+
 
        printf("\n");
        printf("Game Engine Specific Options:\n");
        BLI_argsPrintArgDoc(ba, "-g");
 
        printf("\n");
-       printf("Misc Options:\n");
+       printf("Python Options:\n");
+       BLI_argsPrintArgDoc(ba, "--enable-autoexec");
+       BLI_argsPrintArgDoc(ba, "--disable-autoexec");
+
+       printf("\n");
+
+       BLI_argsPrintArgDoc(ba, "--python");
+       BLI_argsPrintArgDoc(ba, "--python-text");
+       BLI_argsPrintArgDoc(ba, "--python-console");
+       BLI_argsPrintArgDoc(ba, "--addons");
+
+
+       printf("\n");
+       printf("Debug Options:\n");
        BLI_argsPrintArgDoc(ba, "--debug");
-       BLI_argsPrintArgDoc(ba, "--debug-fpe");
-       BLI_argsPrintArgDoc(ba, "--disable-crash-handler");
+       BLI_argsPrintArgDoc(ba, "--debug-value");
 
+       printf("\n");
+       BLI_argsPrintArgDoc(ba, "--debug-events");
 #ifdef WITH_FFMPEG
        BLI_argsPrintArgDoc(ba, "--debug-ffmpeg");
 #endif
-
+       BLI_argsPrintArgDoc(ba, "--debug-handlers");
 #ifdef WITH_LIBMV
        BLI_argsPrintArgDoc(ba, "--debug-libmv");
 #endif
+       BLI_argsPrintArgDoc(ba, "--debug-jobs");
+       BLI_argsPrintArgDoc(ba, "--debug-python");
+
+       BLI_argsPrintArgDoc(ba, "--debug-wm");
+       BLI_argsPrintArgDoc(ba, "--debug-all");
+
+       printf("\n");
+       BLI_argsPrintArgDoc(ba, "--debug-fpe");
+       BLI_argsPrintArgDoc(ba, "--disable-crash-handler");
 
        printf("\n");
+       printf("Misc Options:\n");
        BLI_argsPrintArgDoc(ba, "--factory-startup");
        printf("\n");
        BLI_argsPrintArgDoc(ba, "--env-system-config");
@@ -302,18 +328,6 @@ static int print_help(int UNUSED(argc), const char **UNUSED(argv), void *data)
 
        BLI_argsPrintArgDoc(ba, "--help");
 
-       printf("\n");
-
-       BLI_argsPrintArgDoc(ba, "--enable-autoexec");
-       BLI_argsPrintArgDoc(ba, "--disable-autoexec");
-
-       printf("\n");
-
-       BLI_argsPrintArgDoc(ba, "--python");
-       BLI_argsPrintArgDoc(ba, "--python-text");
-       BLI_argsPrintArgDoc(ba, "--python-console");
-       BLI_argsPrintArgDoc(ba, "--addons");
-
 #ifdef WIN32
        BLI_argsPrintArgDoc(ba, "-R");
        BLI_argsPrintArgDoc(ba, "-r");
index e6f1cc56eb09e459a9cba2dfdcde850226ad2f18..effc06cd15f60326251703dee3ed900c178cb399 100644 (file)
@@ -27,9 +27,13 @@ import bpy
 import sys
 
 USE_ATTRSET = False
+USE_FILES = ""  # "/mango/"
 USE_RANDOM = False
+USE_RANDOM_SCREEN = False
 RANDOM_SEED = [1]  # so we can redo crashes
-RANDOM_RESET = 0.1  # 10% chance of resetting on each mew operator
+RANDOM_RESET = 0.1  # 10% chance of resetting on each new operator
+RANDOM_MULTIPLY = 10
+
 
 op_blacklist = (
     "script.reload",
@@ -50,8 +54,13 @@ op_blacklist = (
     "nla.bake",                # OK but slow
     "*.*_export",
     "*.*_import",
+    "ed.undo",
     "ed.undo_push",
+    "script.autoexec_warn_clear",
+    "screen.delete",           # already used for random screens
     "wm.blenderplayer_start",
+    "wm.recover_auto_save",
+    "wm.quit_blender",
     "wm.url_open",
     "wm.doc_view",
     "wm.doc_edit",
@@ -78,6 +87,33 @@ op_blacklist = (
     )
 
 
+def blend_list(mainpath):
+    import os
+    from os.path import join, splitext
+
+    def file_list(path, filename_check=None):
+        for dirpath, dirnames, filenames in os.walk(path):
+
+            # skip '.svn'
+            if dirpath.startswith("."):
+                continue
+
+            for filename in filenames:
+                filepath = join(dirpath, filename)
+                if filename_check is None or filename_check(filepath):
+                    yield filepath
+
+    def is_blend(filename):
+        ext = splitext(filename)[1]
+        return (ext in {".blend",})
+
+    return list(sorted(file_list(mainpath, is_blend)))
+
+if USE_FILES:
+    USE_FILES_LS = blend_list(USE_FILES)
+    # print(USE_FILES_LS)
+
+
 def filter_op_list(operators):
     from fnmatch import fnmatchcase
 
@@ -98,6 +134,18 @@ def reset_blend():
         scene.frame_start = 1
         scene.frame_end = 5
 
+    if USE_RANDOM_SCREEN:
+        import random
+        for i in range(random.randint(0, len(bpy.data.screens))):
+            bpy.ops.screen.delete()
+        print("Scree IS", bpy.context.screen)
+
+
+def reset_file():
+    import random
+    f = USE_FILES_LS[random.randint(0, len(USE_FILES_LS) - 1)]
+    bpy.ops.wm.open_mainfile(filepath=f)
+
 
 if USE_ATTRSET:
     def build_property_typemap(skip_classes):
@@ -167,12 +215,14 @@ if USE_ATTRSET:
 
     # main function
     _random_values = (
-        None, object,
-        1, 0.1, -1,
+        None, object, type,
+        1, 0.1, -1,  # float("nan"),
         "", "test", b"", b"test",
         (), [], {},
         (10,), (10, 20), (0, 0, 0),
-        {},
+        {0: "", 1: "hello", 2: "test"}, {"": 0, "hello": 1, "test": 2},
+        set(), {"", "test", "."}, {None, ..., type},
+        range(10), (" " * i for i in range(10)),
         )
 
     def attrset_data():
@@ -194,11 +244,6 @@ if USE_ATTRSET:
 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():
@@ -207,7 +252,18 @@ def run_ops(operators, setup_func=None, reset=True):
 
             # disable will get blender in a bad state and crash easy!
             if reset:
-                reset_blend()
+                reset_test = True
+                if USE_RANDOM:
+                    import random
+                    if random.random() < (1.0 - RANDOM_RESET):
+                        reset_test = False
+
+                if reset_test:
+                    if USE_FILES:
+                        reset_file()
+                    else:
+                        reset_blend()
+                del reset_test
 
             if USE_RANDOM:
                 # we can't be sure it will work
@@ -386,12 +442,17 @@ def main():
     if USE_RANDOM:
         import random
         random.seed(RANDOM_SEED[0])
+        operators = operators * RANDOM_MULTIPLY
         random.shuffle(operators)
 
     # 2 passes, first just run setup_func to make sure they are ok
     for operators_test in ((), operators):
         # Run the operator tests in different contexts
         run_ops(operators_test, setup_func=lambda: None)
+        
+        if USE_FILES:
+            continue
+
         run_ops(operators_test, setup_func=ctx_clear_scene)
         # object modes
         run_ops(operators_test, setup_func=ctx_object_empty)