Merged revision(s) 57671-57767 from trunk/blender into soc-2013-dingto
authorThomas Dinges <blender@dingto.org>
Wed, 26 Jun 2013 11:46:55 +0000 (11:46 +0000)
committerThomas Dinges <blender@dingto.org>
Wed, 26 Jun 2013 11:46:55 +0000 (11:46 +0000)
175 files changed:
build_files/build_environment/install_deps.sh
build_files/buildbot/slave_test.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
doc/python_api/examples/mathutils.Vector.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_session.cpp
intern/cycles/render/graph.cpp
intern/cycles/render/graph.h
intern/cycles/render/nodes.cpp
intern/cycles/render/nodes.h
intern/cycles/render/session.cpp
release/datafiles/startup.blend
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_bpath.h
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/BKE_lattice.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/autoexec.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/bpath.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/script.c [deleted file]
source/blender/blenkernel/intern/tracking.c
source/blender/blenlib/BLI_scanfill.h
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/graph.c
source/blender/blenlib/intern/math_color_inline.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenloader/intern/readfile.c
source/blender/bmesh/intern/bmesh_edgeloop.c
source/blender/bmesh/intern/bmesh_iterators.h
source/blender/bmesh/intern/bmesh_marking.c
source/blender/bmesh/intern/bmesh_marking.h
source/blender/bmesh/intern/bmesh_mesh_conv.c
source/blender/bmesh/intern/bmesh_mesh_conv.h
source/blender/bmesh/intern/bmesh_walkers.c
source/blender/bmesh/operators/bmo_beautify.c
source/blender/bmesh/operators/bmo_bridge.c
source/blender/bmesh/operators/bmo_dupe.c
source/blender/bmesh/operators/bmo_mirror.c
source/blender/bmesh/operators/bmo_poke.c
source/blender/bmesh/tools/bmesh_bevel.c
source/blender/bmesh/tools/bmesh_decimate_collapse.c
source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationExporter.h
source/blender/collada/SkinInfo.cpp
source/blender/compositor/SConscript
source/blender/editors/curve/curve_ops.c
source/blender/editors/include/ED_mesh.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_screen.h
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_bevel.c
source/blender/editors/mesh/editmesh_inset.c
source/blender/editors/mesh/editmesh_path.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/mesh_ops.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/metaball/mball_ops.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/physics_ops.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_opengl.c
source/blender/editors/screen/area.c
source/blender/editors/sculpt_paint/paint_hide.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_api/spacetypes.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_ops.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_logic/logic_ops.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_script/space_script.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_userpref/space_userpref.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_iterators.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_manipulator.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/util/undo.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/freestyle/SConscript
source/blender/freestyle/intern/stroke/StrokeRep.cpp
source/blender/freestyle/intern/view_map/SteerableViewMap.h
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_draw.c
source/blender/gpu/shaders/gpu_shader_material.glsl
source/blender/imbuf/intern/thumbs.c
source/blender/imbuf/intern/util.c
source/blender/makesdna/DNA_key_types.h
source/blender/makesdna/DNA_lattice_types.h
source/blender/makesrna/intern/rna_key.c
source/blender/makesrna/intern/rna_lattice.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_space.c
source/blender/modifiers/intern/MOD_multires.c
source/blender/nodes/intern/node_socket.c
source/blender/python/bmesh/bmesh_py_api.c
source/blender/python/bmesh/bmesh_py_types.c
source/blender/python/intern/bpy.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_operators.c
source/creator/creator.c
source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/BL_Action.cpp
source/gameengine/Ketsji/KX_Dome.cpp
source/gameengine/Ketsji/KX_IPO_SGController.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h

index 2ac3a75688e3198a098a0ebe220c6b57d5d3c9ce..9c93214db4e7df4b44476c7883241d57620575c2 100755 (executable)
@@ -229,7 +229,7 @@ LLVM_FORCE_REBUILD=false
 LLVM_SKIP=false
 
 # OSL needs to be compiled for now!
-OSL_VERSION="1.3.0"
+OSL_VERSION="1.3.2"
 OSL_SOURCE="https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz"
 OSL_FORCE_REBUILD=false
 OSL_SKIP=false
index f79ef7cf5c6a9d1cc5ca163c79bf216ac7a31673..d5acc8fd7a667b4be3be73e20ddebfb8a5ba5150 100644 (file)
@@ -31,7 +31,7 @@ builder = sys.argv[1]
 # we run from build/ directory
 blender_dir = '../blender'
 
-if builder.find('cmake') != -1:
+if "cmake" in builder:
     # cmake
     retcode = subprocess.call(['ctest', '.' '--output-on-failure'])
     sys.exit(retcode)
index 101d0402757e54101859503785063e4ab1903d4c..f1597a66538e755dde0d5241e436d9d9054c0766 100644 (file)
@@ -3,10 +3,9 @@ import subprocess
 CL_OUT = subprocess.Popen(["cl.exe"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
 CL_STDOUT, CL_STDERR = CL_OUT.communicate()
 
-if CL_STDERR.find("Version 15.00.") == -1:
+if "17.00." in CL_STDERR:
     VC_VERSION = '11.0'
     LCGDIR = '#../lib/windows_vc11'
-    
 else:
     VC_VERSION = '9.0'
     LCGDIR = '#../lib/windows'
@@ -215,7 +214,12 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
 #CUDA
 WITH_BF_CYCLES_CUDA_BINARIES = False
 #BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
-BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
+
+# Workaround for ptxas.exe crash on VS2012 and cuda 5.5
+if VC_VERSION == '11.0':
+       BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
+else:
+       BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
 
 #Ray trace optimization
 WITH_BF_RAYOPTIMIZATION = True
index 803cac144aba919be10d7446b79739c51418d3ea..a13f417c36c70a2d3753bc94e65f11fc00947b9c 100644 (file)
@@ -3,10 +3,9 @@ import subprocess
 CL_OUT = subprocess.Popen(["cl.exe"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
 CL_STDOUT, CL_STDERR = CL_OUT.communicate()
 
-if CL_STDERR.find("Version 15.00.") == -1:
+if "17.00." in CL_STDERR:
     VC_VERSION = '11.0'
     LCGDIR = '#../lib/win64_vc11'
-    
 else:
     VC_VERSION = '9.0'
     LCGDIR = '#../lib/win64'
index c6cb88faebc5c1cf858e6d09275fcfac565cd963..24bdd32ed2623c1f240bc227f6c4a8a38bc6fa10 100644 (file)
@@ -847,7 +847,7 @@ class BlenderEnvironment(SConsEnvironment):
 
         def list_substring(quickie, libname):
             for q in quickie:
-                if libname.find(q) != -1:
+                if q in libname:
                     return True
             return False
 
index 90674113f4735c8070e233667c2e94ebbd73e4af..53dd99a79713c16e207160a851774e8fddc47334 100644 (file)
@@ -674,10 +674,10 @@ def buildslave(target=None, source=None, env=None):
     if platform == 'linux':
         import platform
 
-        if env['BF_INSTALLDIR'].find('glibc27') != -1:
-            glibc="glibc27"
-        elif env['BF_INSTALLDIR'].find('glibc211') != -1:
-            glibc="glibc211"
+        if "glibc27" in env['BF_INSTALLDIR']:
+            glibc = "glibc27"
+        elif "glibc211" in env['BF_INSTALLDIR']:
+            glibc = "glibc211"
 
         bitness = platform.architecture()[0]
         if bitness == '64bit':
index bf1fc70353f52978b027243e79544c556118fd2e..14b8829c3b5a94e2b8c45d37ecf8273a5f6458f3 100644 (file)
@@ -4,7 +4,7 @@ import mathutils
 vec = mathutils.Vector((0.0, 0.0, 1.0))
 
 # unit length vector
-vec_a = vec.copy().normalize()
+vec_a = vec.normalized()
 
 vec_b = mathutils.Vector((0.0, 1.0, 2.0))
 
index f90881b9338a91f625332f905a6217a48d6b186b..5dd5cbf0ad4077192f5c6ae3cd43da460545b033 100644 (file)
@@ -20,7 +20,7 @@
 
 import bpy
 
-from bpy.types import Panel, Menu
+from bpy.types import Panel, Menu, Operator
 
 
 class CYCLES_MT_integrator_presets(Menu):
@@ -82,7 +82,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
             sub.prop(cscene, "mesh_light_samples", text="Mesh Light")
             sub.prop(cscene, "subsurface_samples", text="Subsurface")
 
-        if cscene.feature_set == 'EXPERIMENTAL':
+        if cscene.feature_set == 'EXPERIMENTAL' and (device_type == 'NONE' or cscene.device == 'CPU'):
             layout.row().prop(cscene, "sampling_pattern", text="Pattern")
 
         for rl in scene.render.layers:
@@ -544,6 +544,26 @@ class CyclesObject_PT_ray_visibility(CyclesButtonsPanel, Panel):
             flow.prop(visibility, "shadow")
 
 
+class CYCLES_OT_use_shading_nodes(Operator):
+    """Enable nodes on a material, world or lamp"""
+    bl_idname = "cycles.use_shading_nodes"
+    bl_label = "Use Nodes"
+
+    @classmethod
+    def poll(cls, context):
+        return context.material or context.world or context.lamp
+
+    def execute(self, context):
+        if context.material:
+            context.material.use_nodes = True
+        elif context.world:
+            context.world.use_nodes = True
+        elif context.lamp:
+            context.lamp.use_nodes = True
+
+        return {'FINISHED'}
+
+
 def find_node(material, nodetype):
     if material and material.node_tree:
         ntree = material.node_tree
@@ -565,7 +585,7 @@ def find_node_input(node, name):
 
 def panel_node_draw(layout, id_data, output_type, input_name):
     if not id_data.use_nodes:
-        layout.prop(id_data, "use_nodes", icon='NODETREE')
+        layout.operator("cycles.use_shading_nodes", icon='NODETREE')
         return False
 
     ntree = id_data.node_tree
index ecdc631e39a107ee7622869e442dcc82442b0850..86bdbc0749f572ca3667eb4772ec3945ac36ab2b 100644 (file)
@@ -616,16 +616,22 @@ void BlenderSession::update_status_progress()
        get_status(status, substatus);
        get_progress(progress, total_time);
 
-       timestatus = string_printf("Mem: %.2fM, Peak: %.2fM | ", mem_used, mem_peak);
+       timestatus = string_printf("Mem:%.2fM, Peak:%.2fM", mem_used, mem_peak);
 
-       timestatus += b_scene.name();
-       if(b_rlay_name != "")
-               timestatus += ", "  + b_rlay_name;
-       timestatus += " | ";
+       if(background) {
+               timestatus += " | " + b_scene.name();
+               if(b_rlay_name != "")
+                       timestatus += ", "  + b_rlay_name;
+       }
+       else {
+               timestatus += " | ";
 
-       BLI_timestr(total_time, time_str, sizeof(time_str));
-       timestatus += "Elapsed: " + string(time_str) + " | ";
+               BLI_timestr(total_time, time_str, sizeof(time_str));
+               timestatus += "Time:" + string(time_str);
+       }
 
+       if(status.size() > 0)
+               status = " | " + status;
        if(substatus.size() > 0)
                status += " | " + substatus;
 
index f9a4a69c954322b76f51f5f9220db97c274fa2df..515bbe9233522e69f8a05a064c0d14a86f1dc9b8 100644 (file)
@@ -199,7 +199,7 @@ void ShaderGraph::connect(ShaderOutput *from, ShaderInput *to)
                }
 
                /* add automatic conversion node in case of type mismatch */
-               ShaderNode *convert = add(new ConvertNode(from->type, to->type));
+               ShaderNode *convert = add(new ConvertNode(from->type, to->type, true));
 
                connect(from, convert->inputs[0]);
                connect(convert->outputs[0], to);
@@ -341,6 +341,24 @@ void ShaderGraph::remove_unneeded_nodes()
                        }
                        else {
                                foreach(ShaderInput *to, links) {
+                                       /* remove any autoconvert nodes too if they lead to
+                                        * sockets with an automatically set default value */
+                                       ShaderNode *tonode = to->parent;
+
+                                       if(tonode->special_type == SHADER_SPECIAL_TYPE_AUTOCONVERT) {
+                                               bool all_links_removed = true;
+
+                                               foreach(ShaderInput *autoin, tonode->outputs[0]->links) {
+                                                       if(autoin->default_value == ShaderInput::NONE)
+                                                               all_links_removed = false;
+                                                       else
+                                                               disconnect(autoin);
+                                               }
+
+                                               if(all_links_removed)
+                                                       removed[tonode->id] = true;
+                                       }
+
                                        disconnect(to);
                                        
                                        /* transfer the default input value to the target socket */
@@ -352,10 +370,10 @@ void ShaderGraph::remove_unneeded_nodes()
                        removed[proxy->id] = true;
                        any_node_removed = true;
                }
-
-               /* remove useless mix closures nodes */
-               if(node->special_type == SHADER_SPECIAL_TYPE_MIX_CLOSURE) {
+               else if(node->special_type == SHADER_SPECIAL_TYPE_MIX_CLOSURE) {
                        MixClosureNode *mix = static_cast<MixClosureNode*>(node);
+
+                       /* remove useless mix closures nodes */
                        if(mix->outputs[0]->links.size() && mix->inputs[1]->link == mix->inputs[2]->link) {
                                ShaderOutput *output = mix->inputs[1]->link;
                                vector<ShaderInput*> inputs = mix->outputs[0]->links;
@@ -370,15 +388,11 @@ void ShaderGraph::remove_unneeded_nodes()
                                                connect(output, input);
                                }
                        }
-               }
                
-               /* remove unused mix closure input when factor is 0.0 or 1.0 */
-               if(node->special_type == SHADER_SPECIAL_TYPE_MIX_CLOSURE) {
-                       MixClosureNode *mix = static_cast<MixClosureNode*>(node);
-                       /* Check for closure links and make sure factor link is disconnected */
+                       /* remove unused mix closure input when factor is 0.0 or 1.0 */
+                       /* check for closure links and make sure factor link is disconnected */
                        if(mix->outputs[0]->links.size() && mix->inputs[1]->link && mix->inputs[2]->link && !mix->inputs[0]->link) {
-                       
-                               /* Factor 0.0 */
+                               /* factor 0.0 */
                                if(mix->inputs[0]->value.x == 0.0f) {
                                        ShaderOutput *output = mix->inputs[1]->link;
                                        vector<ShaderInput*> inputs = mix->outputs[0]->links;
@@ -393,7 +407,7 @@ void ShaderGraph::remove_unneeded_nodes()
                                                        connect(output, input);
                                        }
                                }
-                               /* Factor 1.0 */
+                               /* factor 1.0 */
                                else if(mix->inputs[0]->value.x == 1.0f) {
                                        ShaderOutput *output = mix->inputs[2]->link;
                                        vector<ShaderInput*> inputs = mix->outputs[0]->links;
index 4d1d45ee924962b24aa52e28ae40082acc874e74..da8ed987346f93283e411e215ec5a77b33d9aa44 100644 (file)
@@ -75,7 +75,8 @@ enum ShaderBump {
 enum ShaderNodeSpecialType {
        SHADER_SPECIAL_TYPE_NONE,
        SHADER_SPECIAL_TYPE_PROXY,
-       SHADER_SPECIAL_TYPE_MIX_CLOSURE
+       SHADER_SPECIAL_TYPE_MIX_CLOSURE,
+       SHADER_SPECIAL_TYPE_AUTOCONVERT
 };
 
 /* Enum
index 038b9c24b8a4f59bf99ab9971407520d001f9e1f..3fbcadee42390504af40b450803faf00aa5dcdba 100644 (file)
@@ -1121,12 +1121,15 @@ void MappingNode::compile(OSLCompiler& compiler)
 
 /* Convert */
 
-ConvertNode::ConvertNode(ShaderSocketType from_, ShaderSocketType to_)
+ConvertNode::ConvertNode(ShaderSocketType from_, ShaderSocketType to_, bool autoconvert)
 : ShaderNode("convert")
 {
        from = from_;
        to = to_;
 
+       if(autoconvert)
+               special_type = SHADER_SPECIAL_TYPE_AUTOCONVERT;
+
        assert(from != to);
 
        if(from == SHADER_SOCKET_FLOAT)
@@ -1271,7 +1274,7 @@ void ProxyNode::compile(OSLCompiler& compiler)
 /* BSDF Closure */
 
 BsdfNode::BsdfNode(bool scattering_)
-: ShaderNode("subsurface_scattering"), scattering(scattering_)
+: ShaderNode("bsdf"), scattering(scattering_)
 {
        closure = ccl::CLOSURE_BSSRDF_ID;
 
index 7290465739080a485855278c765981a54d176248..670d8da7825feb5f0a81d37a0662d3202cad58dc 100644 (file)
@@ -182,7 +182,7 @@ public:
 
 class ConvertNode : public ShaderNode {
 public:
-       ConvertNode(ShaderSocketType from, ShaderSocketType to);
+       ConvertNode(ShaderSocketType from, ShaderSocketType to, bool autoconvert = false);
        SHADER_NODE_BASE_CLASS(ConvertNode)
 
        ShaderSocketType from, to;
index 44364418dcf6d0c26f0807e51f3ec99c51d18a05..d13e86429d6f2bf3878f3891239accb837ef2510 100644 (file)
@@ -791,12 +791,16 @@ void Session::update_status_time(bool show_pause, bool show_done)
        else
                substatus = string_printf("Path Tracing Sample %d/%d", sample+1, tile_manager.num_samples);
        
-       if(show_pause)
+       if(show_pause) {
                status = "Paused";
-       else if(show_done)
+       }
+       else if(show_done) {
                status = "Done";
-       else
-               status = "Rendering";
+       }
+       else {
+               status = substatus;
+               substatus = "";
+       }
 
        progress.set_status(status, substatus);
 
index e7177159fae6e18edebabcb49aecd633b843b404..805308cf6629f2517aa45ab14d2676d204bc4a0d 100644 (file)
Binary files a/release/datafiles/startup.blend and b/release/datafiles/startup.blend differ
index 74f9d36db0a257bf3c4825c20eb87fef9aa3082b..3dedfac103ae01035b2556a61c80542ba41df1ea 100644 (file)
@@ -1317,8 +1317,8 @@ class VIEW3D_MT_vertex_group(Menu):
             if ob.vertex_groups.active:
                 layout.separator()
                 layout.operator("object.vertex_group_assign", text="Assign to Active Group").new = False
-                layout.operator("object.vertex_group_remove_from", text="Remove from Active Group").all = False
-                layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True
+                layout.operator("object.vertex_group_remove_from", text="Remove from Active Group").use_all_groups = False
+                layout.operator("object.vertex_group_remove_from", text="Remove from All").use_all_groups = True
                 layout.separator()
 
         if ob.vertex_groups.active:
index 16a8b1be85bd6d040f483d9c852c6e0607a90663..90d5ca18b0ca2469c4944be31a406cca71594de2 100644 (file)
@@ -41,12 +41,12 @@ struct ReportList;
 
 /* Function that does something with an ID's file path. Should return 1 if the
  * path has changed, and in that case, should write the result to pathOut. */
-typedef int (*BPathVisitor)(void *userdata, char *path_dst, const char *path_src);
+typedef bool (*BPathVisitor)(void *userdata, char *path_dst, const char *path_src);
 /* Executes 'visit' for each path associated with 'id'. */
 void BKE_bpath_traverse_id(struct Main *bmain, struct ID *id, BPathVisitor visit_cb, const int flag, void *userdata);
 void BKE_bpath_traverse_id_list(struct Main *bmain, struct ListBase *lb, BPathVisitor visit_cb, const int flag, void *userdata);
 void BKE_bpath_traverse_main(struct Main *bmain, BPathVisitor visit_cb, const int flag, void *userdata);
-int  BKE_bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src);
+bool BKE_bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src);
 
 /* Functions for temp backup/restore of paths, path count must NOT change */
 void *BKE_bpath_list_backup(struct Main *bmain, const int flag);
@@ -65,7 +65,8 @@ void  BKE_bpath_list_free(void *ls_handle);
 
 /* creates a text file with missing files if there are any */
 void BKE_bpath_missing_files_check(struct Main *bmain, struct ReportList *reports);
-void BKE_bpath_missing_files_find(struct Main *bmain, const char *searchpath, struct ReportList *reports);
+void BKE_bpath_missing_files_find(struct Main *bmain, const char *searchpath, struct ReportList *reports,
+                                  const bool find_all);
 void BKE_bpath_relative_convert(struct Main *bmain, const char *basedir, struct ReportList *reports);
 void BKE_bpath_absolute_convert(struct Main *bmain, const char *basedir, struct ReportList *reports);
 
index 8a55d3e8a176ec1cfd2a83e729062378003f9cbe..0699344a8878c24d08062a936d58ad8b9d64b7af 100644 (file)
@@ -192,8 +192,7 @@ enum {
 /* G.moving, signals drawing in (3d) window to denote transform */
 #define G_TRANSFORM_OBJ         1
 #define G_TRANSFORM_EDIT        2
-#define G_TRANSFORM_MANIP       4
-#define G_TRANSFORM_PARTICLE    8
+#define G_TRANSFORM_SEQ         4
 
 /* G.special1 */
 
index b0bf95138147fedaaea18b2bccda47bb4c73be87..9b29412675bd00dba7497722edd5d72b0d0fdffe 100644 (file)
@@ -82,5 +82,8 @@ void BKE_lattice_center_median(struct Lattice *lt, float cent[3]);
 void BKE_lattice_center_bounds(struct Lattice *lt, float cent[3]);
 void BKE_lattice_translate(struct Lattice *lt, float offset[3], int do_keys);
 
+int  BKE_lattice_index_from_uvw(struct Lattice *lt, const int u, const int v, const int w);
+void BKE_lattice_index_to_uvw(struct Lattice *lt, const int index, int *r_u, int *r_v, int *r_w);
+
 #endif
 
index 339d13b06b2df6a073424806d6eb6f451999e3ce..7481a403dc882c1589a5dd8b742dd6a855dc2384 100644 (file)
@@ -138,18 +138,26 @@ int BKE_mesh_edge_other_vert(const struct MEdge *e, int v);
 
 /* update the hide flag for edges and polys from the corresponding
  * flag in verts */
-void BKE_mesh_flush_hidden_from_verts(const struct MVert *mvert,
-                                      const struct MLoop *mloop,
-                                      struct MEdge *medge, int totedge,
-                                      struct MPoly *mpoly, int totpoly);
+void BKE_mesh_flush_hidden_from_verts_ex(const struct MVert *mvert,
+                                         const struct MLoop *mloop,
+                                         struct MEdge *medge, const int totedge,
+                                         struct MPoly *mpoly, const int totpoly);
+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,
+                                         const struct MPoly *mpoly, const int totpoly);
+void BKE_mesh_flush_hidden_from_polys(struct Mesh *me);
+
 
 void BKE_mesh_flush_select_from_polys_ex(struct MVert *mvert,       const int totvert,
-                                         struct MLoop *mloop,
+                                         const struct MLoop *mloop,
                                          struct MEdge *medge,       const int totedge,
                                          const struct MPoly *mpoly, const int totpoly);
 void BKE_mesh_flush_select_from_polys(struct Mesh *me);
 void BKE_mesh_flush_select_from_verts_ex(const struct MVert *mvert, const int totvert,
-                                         struct MLoop *mloop,
+                                         const struct MLoop *mloop,
                                          struct MEdge *medge,       const int totedge,
                                          struct MPoly *mpoly,       const int totpoly);
 void BKE_mesh_flush_select_from_verts(struct Mesh *me);
index 2b753cba098f1186d73287cf1591237d3ac16d6b..56b550a6f5d74b7249bf2ff5109b9538a3f4a41d 100644 (file)
@@ -380,6 +380,8 @@ int psys_particle_dm_face_lookup(struct Object *ob, struct DerivedMesh *dm, int
 
 void reset_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, float dtime, float cfra);
 
+float psys_get_current_display_percentage(struct ParticleSystem *psys);
+
 /* psys_reset */
 #define PSYS_RESET_ALL          1
 #define PSYS_RESET_DEPSGRAPH    2
index 5407e22e49eadb9035a3568e421415fa7a096f3b..b5a6c6fb8212de3194d18f3d64ada403fd4bf5b1 100644 (file)
@@ -78,7 +78,7 @@ typedef struct SpaceType {
        /* exit is called when the area is hidden or removed */
        void (*exit)(struct wmWindowManager *, struct ScrArea *);
        /* Listeners can react to bContext changes */
-       void (*listener)(struct ScrArea *, struct wmNotifier *);
+       void (*listener)(struct bScreen *sc, struct ScrArea *, struct wmNotifier *);
        
        /* refresh context, called after filereads, ED_area_tag_refresh() */
        void (*refresh)(const struct bContext *, struct ScrArea *);
@@ -123,7 +123,7 @@ typedef struct ARegionType {
        /* draw entirely, view changes should be handled here */
        void (*draw)(const struct bContext *, struct ARegion *);
        /* contextual changes should be handled here */
-       void (*listener)(struct ARegion *, struct wmNotifier *);
+       void (*listener)(struct bScreen *sc, struct ScrArea *, struct ARegion *, struct wmNotifier *);
        
        void (*free)(struct ARegion *);
 
index 7e1355b5421d616f1667d7d667e4dd64300f9b5b..e98d326c4431dc6ee402cf810e47c29fe0cdc1cd 100644 (file)
@@ -137,7 +137,6 @@ set(SRC
        intern/sca.c
        intern/scene.c
        intern/screen.c
-       intern/script.c
        intern/seqcache.c
        intern/seqeffects.c
        intern/seqmodifier.c
index 35510fe64d5f2f385a04ff032f3f9f6c1f3250d7..9fea3d2e13f507d7dbfa8053844c80b3a4c05db8 100644 (file)
@@ -1724,8 +1724,11 @@ ListBase *object_duplilist_ex(Scene *sce, Object *ob, bool update, bool for_rend
        int persistent_id[MAX_DUPLI_RECUR] = {0};
        int flag = 0;
 
-       if (update)     flag |= DUPLILIST_DO_UPDATE;
-       if (for_render) flag |= DUPLILIST_FOR_RENDER;
+       /* don't allow BKE_object_handle_update for viewport during render, can crash */
+       if (update && !(G.is_rendering && !for_render))
+               flag |= DUPLILIST_DO_UPDATE;
+       if (for_render)
+               flag |= DUPLILIST_FOR_RENDER;
 
        duplilist->first = duplilist->last = NULL;
        object_duplilist_recursive((ID *)sce, sce, ob, duplilist, NULL, persistent_id, 0, 0, flag);
index c27343bf80a03926eb9d1addd878da4ddee9ff6b..872780bd50a724765c073111323e32d06f928a1a 100644 (file)
@@ -20,7 +20,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/blenkernel/intern/armature.c
+/** \file blender/blenkernel/intern/autoexec.c
  *  \ingroup bke
  *
  * Currently just checks if a blend file can be trusted to autoexec,
index 1e7aba6d25bb6ea7d09592d4536ee0bd39b0fb20..29a8a615601a5f8630fb8f2a55eac9166038f311 100644 (file)
@@ -170,11 +170,11 @@ static void clear_global(void)
        G.main = NULL;
 }
 
-static int clean_paths_visit_cb(void *UNUSED(userdata), char *path_dst, const char *path_src)
+static bool clean_paths_visit_cb(void *UNUSED(userdata), char *path_dst, const char *path_src)
 {
        strcpy(path_dst, path_src);
        BLI_clean(path_dst);
-       return (strcmp(path_dst, path_src) == 0) ? FALSE : TRUE;
+       return !STREQ(path_dst, path_src);
 }
 
 /* make sure path names are correct for OS */
index fe86b413a998a6a1fe7f71cf4696a2b84e2b418b..6699cbcff2d806ef01fc072bf3f936a28fcf125c 100644 (file)
@@ -85,7 +85,7 @@
 
 #include "BKE_bpath.h"  /* own include */
 
-static int checkMissingFiles_visit_cb(void *userdata, char *UNUSED(path_dst), const char *path_src)
+static bool checkMissingFiles_visit_cb(void *userdata, char *UNUSED(path_dst), const char *path_src)
 {
        ReportList *reports = (ReportList *)userdata;
 
@@ -93,7 +93,7 @@ static int checkMissingFiles_visit_cb(void *userdata, char *UNUSED(path_dst), co
                BKE_reportf(reports, RPT_WARNING, "Path '%s' not found", path_src);
        }
 
-       return FALSE;
+       return false;
 }
 
 /* high level function */
@@ -111,14 +111,14 @@ typedef struct BPathRemap_Data {
        int count_failed;
 } BPathRemap_Data;
 
-static int makeFilesRelative_visit_cb(void *userdata, char *path_dst, const char *path_src)
+static bool makeFilesRelative_visit_cb(void *userdata, char *path_dst, const char *path_src)
 {
        BPathRemap_Data *data = (BPathRemap_Data *)userdata;
 
        data->count_tot++;
 
        if (BLI_path_is_rel(path_src)) {
-               return FALSE; /* already relative */
+               return false; /* already relative */
        }
        else {
                strcpy(path_dst, path_src);
@@ -130,7 +130,7 @@ static int makeFilesRelative_visit_cb(void *userdata, char *path_dst, const char
                        BKE_reportf(data->reports, RPT_WARNING, "Path '%s' cannot be made relative", path_src);
                        data->count_failed++;
                }
-               return TRUE;
+               return true;
        }
 }
 
@@ -153,26 +153,26 @@ void BKE_bpath_relative_convert(Main *bmain, const char *basedir, ReportList *re
                    data.count_tot, data.count_changed, data.count_failed);
 }
 
-static int makeFilesAbsolute_visit_cb(void *userdata, char *path_dst, const char *path_src)
+static bool makeFilesAbsolute_visit_cb(void *userdata, char *path_dst, const char *path_src)
 {
        BPathRemap_Data *data = (BPathRemap_Data *)userdata;
 
        data->count_tot++;
 
-       if (BLI_path_is_rel(path_src) == FALSE) {
-               return FALSE; /* already absolute */
+       if (BLI_path_is_rel(path_src) == false) {
+               return false; /* already absolute */
        }
        else {
                strcpy(path_dst, path_src);
                BLI_path_abs(path_dst, data->basedir);
-               if (BLI_path_is_rel(path_dst) == FALSE) {
+               if (BLI_path_is_rel(path_dst) == false) {
                        data->count_changed++;
                }
                else {
                        BKE_reportf(data->reports, RPT_WARNING, "Path '%s' cannot be made absolute", path_src);
                        data->count_failed++;
                }
-               return TRUE;
+               return true;
        }
 }
 
@@ -218,7 +218,7 @@ static int findFileRecursive(char *filename_new,
        struct stat status;
        char path[FILE_MAX];
        int size;
-       int found = FALSE;
+       bool found = false;
 
        dir = opendir(dirname);
 
@@ -230,22 +230,22 @@ static int findFileRecursive(char *filename_new,
 
        while ((de = readdir(dir)) != NULL) {
 
-               if (strcmp(".", de->d_name) == 0 || strcmp("..", de->d_name) == 0)
+               if (STREQ(".", de->d_name) || STREQ("..", de->d_name))
                        continue;
 
                BLI_join_dirfile(path, sizeof(path), dirname, de->d_name);
 
-               if (stat(path, &status) != 0)
+               if (BLI_stat(path, &status) != 0)
                        continue;  /* cant stat, don't bother with this file, could print debug info here */
 
                if (S_ISREG(status.st_mode)) { /* is file */
-                       if (strncmp(filename, de->d_name, FILE_MAX) == 0) { /* name matches */
+                       if (STREQLEN(filename, de->d_name, FILE_MAX)) { /* name matches */
                                /* open the file to read its size */
                                size = status.st_size;
                                if ((size > 0) && (size > *filesize)) { /* find the biggest file */
                                        *filesize = size;
                                        BLI_strncpy(filename_new, path, FILE_MAX);
-                                       found = TRUE;
+                                       found = true;
                                }
                        }
                }
@@ -263,11 +263,12 @@ static int findFileRecursive(char *filename_new,
 
 typedef struct BPathFind_Data {
        const char *basedir;
-       char searchdir[FILE_MAX];
+       const char *searchdir;
        ReportList *reports;
+       bool find_all;
 } BPathFind_Data;
 
-static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char *path_src)
+static bool findMissingFiles_visit_cb(void *userdata, char *path_dst, const char *path_src)
 {
        BPathFind_Data *data = (BPathFind_Data *)userdata;
        char filename_new[FILE_MAX];
@@ -276,6 +277,12 @@ static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char
        int recur_depth = 0;
        int found;
 
+       if (data->find_all == false) {
+               if (BLI_exists(path_src)) {
+                       return false;
+               }
+       }
+
        filename_new[0] = '\0';
 
        found = findFileRecursive(filename_new,
@@ -286,32 +293,34 @@ static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char
                BKE_reportf(data->reports, RPT_WARNING,
                            "Could not open directory '%s'",
                            BLI_path_basename(data->searchdir));
-               return FALSE;
+               return false;
        }
-       else if (found == FALSE) {
+       else if (found == false) {
                BKE_reportf(data->reports, RPT_WARNING,
                            "Could not find '%s' in '%s'",
                            BLI_path_basename((char *)path_src), data->searchdir);
-               return FALSE;
+               return false;
        }
        else {
                BLI_strncpy(path_dst, filename_new, FILE_MAX);
-               return TRUE;
+               return true;
        }
 }
 
-void BKE_bpath_missing_files_find(Main *bmain, const char *searchpath, ReportList *reports)
+void BKE_bpath_missing_files_find(Main *bmain, const char *searchpath, ReportList *reports,
+                                  const bool find_all)
 {
        struct BPathFind_Data data = {NULL};
 
        data.reports = reports;
-       BLI_split_dir_part(searchpath, data.searchdir, sizeof(data.searchdir));
+       data.searchdir = searchpath;
+       data.find_all = find_all;
 
-       BKE_bpath_traverse_main(bmain, findMissingFiles_visit_cb, 0, (void *)&data);
+       BKE_bpath_traverse_main(bmain, findMissingFiles_visit_cb, BKE_BPATH_TRAVERSE_ABS, (void *)&data);
 }
 
 /* Run a visitor on a string, replacing the contents of the string as needed. */
-static int rewrite_path_fixed(char *path, BPathVisitor visit_cb, const char *absbase, void *userdata)
+static bool rewrite_path_fixed(char *path, BPathVisitor visit_cb, const char *absbase, void *userdata)
 {
        char path_src_buf[FILE_MAX];
        const char *path_src;
@@ -328,18 +337,18 @@ static int rewrite_path_fixed(char *path, BPathVisitor visit_cb, const char *abs
 
        if (visit_cb(userdata, path_dst, path_src)) {
                BLI_strncpy(path, path_dst, FILE_MAX);
-               return TRUE;
+               return true;
        }
        else {
-               return FALSE;
+               return false;
        }
 }
 
-static int rewrite_path_fixed_dirfile(char path_dir[FILE_MAXDIR],
-                                      char path_file[FILE_MAXFILE],
-                                      BPathVisitor visit_cb,
-                                      const char *absbase,
-                                      void *userdata)
+static bool rewrite_path_fixed_dirfile(char path_dir[FILE_MAXDIR],
+                                       char path_file[FILE_MAXFILE],
+                                       BPathVisitor visit_cb,
+                                       const char *absbase,
+                                       void *userdata)
 {
        char path_src[FILE_MAX];
        char path_dst[FILE_MAX];
@@ -352,14 +361,14 @@ static int rewrite_path_fixed_dirfile(char path_dir[FILE_MAXDIR],
 
        if (visit_cb(userdata, path_dst, (const char *)path_src)) {
                BLI_split_dirfile(path_dst, path_dir, path_file, FILE_MAXDIR, FILE_MAXFILE);
-               return TRUE;
+               return true;
        }
        else {
-               return FALSE;
+               return false;
        }
 }
 
-static int rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *absbase, void *userdata)
+static bool rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *absbase, void *userdata)
 {
        char path_src_buf[FILE_MAX];
        const char *path_src;
@@ -377,10 +386,10 @@ static int rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *ab
        if (visit_cb(userdata, path_dst, path_src)) {
                MEM_freeN((*path));
                (*path) = BLI_strdup(path_dst);
-               return TRUE;
+               return true;
        }
        else {
-               return FALSE;
+               return false;
        }
 }
 
@@ -495,7 +504,7 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
                {
                        VFont *vfont = (VFont *)id;
                        if (vfont->packedfile == NULL || (flag & BKE_BPATH_TRAVERSE_SKIP_PACKED) == 0) {
-                               if (BKE_vfont_is_builtin(vfont) == FALSE) {
+                               if (BKE_vfont_is_builtin(vfont) == false) {
                                        rewrite_path_fixed(((VFont *)id)->name, visit_cb, absbase, bpath_user_data);
                                }
                        }
@@ -632,7 +641,7 @@ void BKE_bpath_traverse_main(Main *bmain, BPathVisitor visit_cb, const int flag,
 
 /* Rewrites a relative path to be relative to the main file - unless the path is
  * absolute, in which case it is not altered. */
-int BKE_bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *path_src)
+bool BKE_bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *path_src)
 {
        /* be sure there is low chance of the path being too short */
        char filepath[(FILE_MAXDIR * 2) + FILE_MAXFILE];
@@ -642,7 +651,7 @@ int BKE_bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *pat
        if (BLI_path_is_rel(base_old)) {
                printf("%s: error, old base path '%s' is not absolute.\n",
                       __func__, base_old);
-               return FALSE;
+               return false;
        }
 
        /* Make referenced file absolute. This would be a side-effect of
@@ -655,11 +664,11 @@ int BKE_bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *pat
                BLI_cleanup_file(base_new, filepath);
                BLI_path_rel(filepath, base_new);
                BLI_strncpy(path_dst, filepath, FILE_MAX);
-               return TRUE;
+               return true;
        }
        else {
                /* Path was not relative to begin with. */
-               return FALSE;
+               return false;
        }
 }
 
@@ -674,7 +683,7 @@ struct PathStore {
        struct PathStore *next, *prev;
 };
 
-static int bpath_list_append(void *userdata, char *UNUSED(path_dst), const char *path_src)
+static bool bpath_list_append(void *userdata, char *UNUSED(path_dst), const char *path_src)
 {
        /* store the path and string in a single alloc */
        ListBase *ls = userdata;
@@ -684,24 +693,24 @@ static int bpath_list_append(void *userdata, char *UNUSED(path_dst), const char
 
        memcpy(filepath, path_src, path_size);
        BLI_addtail(ls, path_store);
-       return FALSE;
+       return false;
 }
 
-static int bpath_list_restore(void *userdata, char *path_dst, const char *path_src)
+static bool bpath_list_restore(void *userdata, char *path_dst, const char *path_src)
 {
        /* assume ls->first wont be NULL because the number of paths can't change!
         * (if they do caller is wrong) */
        ListBase *ls = userdata;
        struct PathStore *path_store = ls->first;
        const char *filepath = (char *)(path_store + 1);
-       int ret;
+       bool ret;
 
-       if (strcmp(path_src, filepath) == 0) {
-               ret = FALSE;
+       if (STREQ(path_src, filepath)) {
+               ret = false;
        }
        else {
                BLI_strncpy(path_dst, filepath, FILE_MAX);
-               ret = TRUE;
+               ret = true;
        }
 
        BLI_freelinkN(ls, path_store);
index 73c722a4849cc92b60dc1ac36547a56fbb6c5fc2..7f6dc680a7468172e4150a2f3781c5e3e029fe7e 100644 (file)
@@ -2232,7 +2232,10 @@ void CDDM_calc_normals_mapping_ex(DerivedMesh *dm, const short only_face_normals
        CDDerivedMesh *cddm = (CDDerivedMesh *)dm;
        float (*face_nors)[3] = NULL;
 
-       if (dm->numVertData == 0) return;
+       if (dm->numVertData == 0) {
+               cddm->dm.dirty &= ~DM_DIRTY_NORMALS;
+               return;
+       }
 
        /* now we skip calculating vertex normals for referenced layer,
         * no need to duplicate verts.
index 732f9918622cbc593604335438c934c6a354ace6..9323531e5fe0ea6194a75bfef2c39994caf31909 100644 (file)
@@ -1276,6 +1276,8 @@ void BKE_color_managed_view_settings_copy(ColorManagedViewSettings *new_settings
 
        if (settings->curve_mapping)
                new_settings->curve_mapping = curvemapping_copy(settings->curve_mapping);
+       else
+               new_settings->curve_mapping = NULL;
 }
 
 void BKE_color_managed_view_settings_free(ColorManagedViewSettings *settings)
index edeef26ed58c9b6a7cc938f610e704137034a249..b82e89d1af65f2fb24b2a34d0ed759acba64199a 100644 (file)
@@ -88,7 +88,7 @@ void defvert_copy_subset(MDeformVert *dvert_dst, const MDeformVert *dvert_src,
                          const bool *vgroup_subset, const int vgroup_tot)
 {
        int defgroup;
-       for (defgroup=0; defgroup < vgroup_tot; defgroup++) {
+       for (defgroup = 0; defgroup < vgroup_tot; defgroup++) {
                if (vgroup_subset[defgroup]) {
                        defvert_copy_index(dvert_dst, dvert_src, defgroup);
                }
index dfa5fcff94cdac48972390392e52c8cf58676f69..e141b9dbabe83cded1dbad094f179f9358a1e6c6 100644 (file)
@@ -289,6 +289,16 @@ void key_curve_position_weights(float t, float data[4], int type)
                data[2] = -0.5f        * t3  + 0.5f * t2   + 0.5f * t    + 0.16666666f;
                data[3] =  0.16666666f * t3;
        }
+       else if (type == KEY_CATMULL_ROM) {
+               t2 = t * t;
+               t3 = t2 * t;
+               fc = 0.5f;
+
+               data[0] = -fc          * t3  + 2.0f * fc          * t2 - fc * t;
+               data[1] =  (2.0f - fc) * t3  + (fc - 3.0f)        * t2 + 1.0f;
+               data[2] =  (fc - 2.0f) * t3  + (3.0f - 2.0f * fc) * t2 + fc * t;
+               data[3] =  fc          * t3  - fc * t2;
+       }
 }
 
 /* first derivative */
@@ -319,6 +329,15 @@ void key_curve_tangent_weights(float t, float data[4], int type)
                data[2] = -1.5f * t2  + t         + 0.5f;
                data[3] =  0.5f * t2;
        }
+       else if (type == KEY_CATMULL_ROM) {
+               t2 = t * t;
+               fc = 0.5f;
+
+               data[0] = -3.0f * fc          * t2  + 4.0f * fc * t                  - fc;
+               data[1] =  3.0f * (2.0f - fc) * t2  + 2.0f * (fc - 3.0f) * t;
+               data[2] =  3.0f * (fc - 2.0f) * t2  + 2.0f * (3.0f - 2.0f * fc) * t  + fc;
+               data[3] =  3.0f * fc          * t2  - 2.0f * fc * t;
+       }
 }
 
 /* second derivative */
@@ -346,6 +365,14 @@ void key_curve_normal_weights(float t, float data[4], int type)
                data[2] = -3.0f * t  + 1.0f;
                data[3] =  1.0f * t;
        }
+       else if (type == KEY_CATMULL_ROM) {
+               fc = 0.5f;
+
+               data[0] = -6.0f * fc          * t  + 4.0f * fc;
+               data[1] =  6.0f * (2.0f - fc) * t  + 2.0f * (fc - 3.0f);
+               data[2] =  6.0f * (fc - 2.0f) * t  + 2.0f * (3.0f - 2.0f * fc);
+               data[3] =  6.0f * fc          * t  - 2.0f * fc;
+       }
 }
 
 static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float t[4], int cycl)
index feb82a34708757c96baade10f7be1691f70864ee..2336844667534025e1e68598024dffab15f41d61 100644 (file)
 
 #include "BKE_deform.h"
 
+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);
+}
+
+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));
+}
 
 void calc_lat_fudu(int flag, int res, float *r_fu, float *r_du)
 {
@@ -867,7 +880,7 @@ int object_deform_mball(Object *ob, ListBase *dispbase)
 
 static BPoint *latt_bp(Lattice *lt, int u, int v, int w)
 {
-       return &lt->def[LT_INDEX(lt, u, v, w)];
+       return &lt->def[BKE_lattice_index_from_uvw(lt, u, v, w)];
 }
 
 void outside_lattice(Lattice *lt)
index 0546c85db67b4010e7c27be6ef986f502490eeac..8361f0c4f6c77ed5b622668ede583706fd48576d 100644 (file)
@@ -151,7 +151,7 @@ typedef struct process {        /* parameters, function, storage */
 
        /* what happens here? floats, I think. */
        /*  float (*function)(void);     */     /* implicit surface function */
-       float (*function)(struct process*, float, float, float);
+       float (*function)(struct process *, float, float, float);
        float size, delta;          /* cube size, normal delta */
        int bounds;                 /* cube range within lattice */
        CUBES *cubes;               /* active cubes */
@@ -2283,7 +2283,7 @@ void BKE_mball_polygonize(Scene *scene, Object *ob, ListBase *dispbase)
 
        if (process.totelem == 0) return;
        if ((G.is_rendering == FALSE) && (mb->flag == MB_UPDATE_NEVER)) return;
-       if (G.moving && mb->flag == MB_UPDATE_FAST) return;
+       if ((G.moving & (G_TRANSFORM_OBJ | G_TRANSFORM_EDIT)) && mb->flag == MB_UPDATE_FAST) return;
 
        process.thresh = mb->thresh;
 
@@ -2325,7 +2325,9 @@ void BKE_mball_polygonize(Scene *scene, Object *ob, ListBase *dispbase)
        }
        else {
                width = mb->wiresize;
-               if (G.moving && mb->flag == MB_UPDATE_HALFRES) width *= 2;
+               if ((G.moving & (G_TRANSFORM_OBJ | G_TRANSFORM_EDIT)) && mb->flag == MB_UPDATE_HALFRES) {
+                       width *= 2;
+               }
        }
        /* nr_cubes is just for safety, minimum is totsize */
        nr_cubes = (int)(0.5f + totsize / width);
index aeb1538ccf0a968ed020a33c1dcb33c3f0c8c4bd..8c6c5d9fd835ab8d7806b54b4c9ecefb6a25fb11 100644 (file)
@@ -2733,8 +2733,14 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata,
                }
 #endif /* USE_TESSFACE_SPEEDUP */
                else {
+#define USE_TESSFACE_CALCNORMAL
+
                        int totfilltri;
 
+#ifdef USE_TESSFACE_CALCNORMAL
+                       float normal[3];
+                       zero_v3(normal);
+#endif
                        ml = mloop + mp->loopstart;
                        
                        BLI_scanfill_begin(&sf_ctx);
@@ -2745,16 +2751,25 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata,
        
                                sf_vert->keyindex = mp->loopstart + j;
        
-                               if (sf_vert_last)
+                               if (sf_vert_last) {
                                        BLI_scanfill_edge_add(&sf_ctx, sf_vert_last, sf_vert);
+#ifdef USE_TESSFACE_CALCNORMAL
+                                       add_newell_cross_v3_v3v3(normal, sf_vert_last->co, sf_vert->co);
+#endif
+                               }
        
                                if (!sf_vert_first)
                                        sf_vert_first = sf_vert;
                                sf_vert_last = sf_vert;
                        }
                        BLI_scanfill_edge_add(&sf_ctx, sf_vert_last, sf_vert_first);
-                       
+#ifdef USE_TESSFACE_CALCNORMAL
+                       add_newell_cross_v3_v3v3(normal, sf_vert_last->co, sf_vert_first->co);
+                       normalize_v3(normal);
+                       totfilltri = BLI_scanfill_calc_ex(&sf_ctx, 0, normal);
+#else
                        totfilltri = BLI_scanfill_calc(&sf_ctx, 0);
+#endif
                        BLI_assert(totfilltri <= mp->totloop - 2);
                        (void)totfilltri;
 
@@ -2779,6 +2794,8 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata,
                        }
        
                        BLI_scanfill_end(&sf_ctx);
+
+#undef USE_TESSFACE_CALCNORMAL
                }
        }
 
@@ -3420,10 +3437,10 @@ int BKE_mesh_edge_other_vert(const MEdge *e, int v)
 
 /* update the hide flag for edges and faces from the corresponding
  * flag in verts */
-void BKE_mesh_flush_hidden_from_verts(const MVert *mvert,
-                                      const MLoop *mloop,
-                                      MEdge *medge, int totedge,
-                                      MPoly *mpoly, int totpoly)
+void BKE_mesh_flush_hidden_from_verts_ex(const MVert *mvert,
+                                         const MLoop *mloop,
+                                         MEdge *medge, const int totedge,
+                                         MPoly *mpoly, const int totpoly)
 {
        int i, j;
        
@@ -3447,12 +3464,59 @@ void BKE_mesh_flush_hidden_from_verts(const MVert *mvert,
                }
        }
 }
+void BKE_mesh_flush_hidden_from_verts(Mesh *me)
+{
+       BKE_mesh_flush_hidden_from_verts_ex(me->mvert, me->mloop,
+                                           me->medge, me->totedge,
+                                           me->mpoly, me->totpoly);
+}
+
+void BKE_mesh_flush_hidden_from_polys_ex(MVert *mvert,
+                                         const MLoop *mloop,
+                                         MEdge *medge, const int UNUSED(totedge),
+                                         const MPoly *mpoly, const int totpoly)
+{
+       const MPoly *mp;
+       int i;
+
+       i = totpoly;
+       for (mp = mpoly; i--; mp++) {
+               if (mp->flag & ME_HIDE) {
+                       const MLoop *ml;
+                       int j;
+                       j = mp->totloop;
+                       for (ml = &mloop[mp->loopstart]; j--; ml++) {
+                               mvert[ml->v].flag |= ME_HIDE;
+                               medge[ml->e].flag |= ME_HIDE;
+                       }
+               }
+       }
+
+       i = totpoly;
+       for (mp = mpoly; i--; mp++) {
+               if ((mp->flag & ME_HIDE) == 0) {
+                       const MLoop *ml;
+                       int j;
+                       j = mp->totloop;
+                       for (ml = &mloop[mp->loopstart]; j--; ml++) {
+                               mvert[ml->v].flag &= ~ME_HIDE;
+                               medge[ml->e].flag &= ~ME_HIDE;
+                       }
+               }
+       }
+}
+void BKE_mesh_flush_hidden_from_polys(Mesh *me)
+{
+       BKE_mesh_flush_hidden_from_polys_ex(me->mvert, me->mloop,
+                                           me->medge, me->totedge,
+                                           me->mpoly, me->totpoly);
+}
 
 /**
  * simple poly -> vert/edge selection.
  */
 void BKE_mesh_flush_select_from_polys_ex(MVert *mvert,       const int totvert,
-                                         MLoop *mloop,
+                                         const MLoop *mloop,
                                          MEdge *medge,       const int totedge,
                                          const MPoly *mpoly, const int totpoly)
 {
@@ -3476,7 +3540,7 @@ void BKE_mesh_flush_select_from_polys_ex(MVert *mvert,       const int totvert,
                /* assume if its selected its not hidden and none of its verts/edges are hidden
                 * (a common assumption)*/
                if (mp->flag & ME_FACE_SEL) {
-                       MLoop *ml;
+                       const MLoop *ml;
                        int j;
                        j = mp->totloop;
                        for (ml = &mloop[mp->loopstart]; j--; ml++) {
@@ -3495,7 +3559,7 @@ void BKE_mesh_flush_select_from_polys(Mesh *me)
 }
 
 void BKE_mesh_flush_select_from_verts_ex(const MVert *mvert, const int UNUSED(totvert),
-                                         MLoop *mloop,
+                                         const MLoop *mloop,
                                          MEdge *medge,       const int totedge,
                                          MPoly *mpoly,       const int totpoly)
 {
@@ -3521,7 +3585,7 @@ void BKE_mesh_flush_select_from_verts_ex(const MVert *mvert, const int UNUSED(to
        for (mp = mpoly; i--; mp++) {
                if ((mp->flag & ME_HIDE) == 0) {
                        int ok = TRUE;
-                       MLoop *ml;
+                       const MLoop *ml;
                        int j;
                        j = mp->totloop;
                        for (ml = &mloop[mp->loopstart]; j--; ml++) {
index 14be1cef8cc6f9103b8354a1b19864cd85e0eaa2..170b4156b21a18787d8ec64b5de47c2a03151d0b 100644 (file)
@@ -3548,33 +3548,39 @@ void init_nodesystem(void)
 
 void free_nodesystem(void) 
 {
-       NODE_TYPES_BEGIN(nt)
-               if (nt->ext.free) {
-                       nt->ext.free(nt->ext.data);
-               }
-       NODE_TYPES_END
-       
-       NODE_SOCKET_TYPES_BEGIN(st)
-               if (st->ext_socket.free)
-                       st->ext_socket.free(st->ext_socket.data);
-               if (st->ext_interface.free)
-                       st->ext_interface.free(st->ext_interface.data);
-       NODE_SOCKET_TYPES_END
-       
-       NODE_TREE_TYPES_BEGIN(nt)
-               if (nt->ext.free) {
-                       nt->ext.free(nt->ext.data);
-               }
-       NODE_TREE_TYPES_END
-       
-       BLI_ghash_free(nodetypes_hash, NULL, node_free_type);
-       nodetypes_hash = NULL;
-       
-       BLI_ghash_free(nodesockettypes_hash, NULL, node_free_socket_type);
-       nodesockettypes_hash = NULL;
-       
-       BLI_ghash_free(nodetreetypes_hash, NULL, ntree_free_type);
-       nodetreetypes_hash = NULL;
+       if (nodetypes_hash) {
+               NODE_TYPES_BEGIN(nt)
+                       if (nt->ext.free) {
+                               nt->ext.free(nt->ext.data);
+                       }
+               NODE_TYPES_END
+
+               BLI_ghash_free(nodetypes_hash, NULL, node_free_type);
+               nodetypes_hash = NULL;
+       }
+
+       if (nodesockettypes_hash) {
+               NODE_SOCKET_TYPES_BEGIN(st)
+                       if (st->ext_socket.free)
+                               st->ext_socket.free(st->ext_socket.data);
+                       if (st->ext_interface.free)
+                               st->ext_interface.free(st->ext_interface.data);
+               NODE_SOCKET_TYPES_END
+
+               BLI_ghash_free(nodesockettypes_hash, NULL, node_free_socket_type);
+               nodesockettypes_hash = NULL;
+       }
+
+       if (nodetreetypes_hash) {
+               NODE_TREE_TYPES_BEGIN(nt)
+                       if (nt->ext.free) {
+                               nt->ext.free(nt->ext.data);
+                       }
+               NODE_TREE_TYPES_END
+
+               BLI_ghash_free(nodetreetypes_hash, NULL, ntree_free_type);
+               nodetreetypes_hash = NULL;
+       }
 }
 
 /* called from BKE_scene_unlink, when deleting a scene goes over all scenes
index af67ada776555b895716466880f64c0d9ea655a1..f97429d7e650be6bbe27beb93a6a8d076819cafc 100644 (file)
@@ -378,7 +378,7 @@ int checkPackedFile(const char *filename, PackedFile *pf)
        BLI_strncpy(name, filename, sizeof(name));
        BLI_path_abs(name, G.main->name);
        
-       if (stat(name, &st)) {
+       if (BLI_stat(name, &st)) {
                ret_val = PF_NOFILE;
        }
        else if (st.st_size != pf->size) {
index 3ab535febb121a0246c5e642c37cfcdbc4dcbd21..f6901c7b81b3889da9577a874c0ecaad8e2744cc 100644 (file)
@@ -734,6 +734,8 @@ void psys_render_restore(Object *ob, ParticleSystem *psys)
 {
        ParticleRenderData *data;
        ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
+       float render_disp = psys_get_current_display_percentage(psys);
+       float disp;
 
        data = psys->renderdata;
        if (!data)
@@ -777,6 +779,20 @@ void psys_render_restore(Object *ob, ParticleSystem *psys)
 
        MEM_freeN(data);
        psys->renderdata = NULL;
+
+       /* restore particle display percentage */
+       disp = psys_get_current_display_percentage(psys);
+
+       if (disp != render_disp) {
+               PARTICLE_P;
+
+               LOOP_PARTICLES {
+                       if (PSYS_FRAND(p) > disp)
+                               pa->flag |= PARS_NO_DISP;
+                       else
+                               pa->flag &= ~PARS_NO_DISP;
+               }
+       }
 }
 
 /* BMESH_TODO, for orig face data, we need to use MPoly */
index 50d2a47a97f21543c4937ff9e3f926b32ee342f7..ec45c9eef40e311171094562350b723700550620 100644 (file)
@@ -123,7 +123,7 @@ static int particles_are_dynamic(ParticleSystem *psys)
                return ELEM3(psys->part->phystype, PART_PHYS_NEWTON, PART_PHYS_BOIDS, PART_PHYS_FLUID);
 }
 
-static int psys_get_current_display_percentage(ParticleSystem *psys)
+float psys_get_current_display_percentage(ParticleSystem *psys)
 {
        ParticleSettings *part=psys->part;
 
@@ -131,10 +131,10 @@ static int psys_get_current_display_percentage(ParticleSystem *psys)
            (part->child_nbr && part->childtype)  ||    /* display percentage applies to children */
            (psys->pointcache->flag & PTCACHE_BAKING))  /* baking is always done with full amount */
        {
-               return 100;
+               return 1.0f;
        }
 
-       return psys->part->disp;
+       return psys->part->disp/100.0f;
 }
 
 static int tot_particles(ParticleSystem *psys, PTCacheID *pid)
@@ -3984,7 +3984,7 @@ static void hair_step(ParticleSimulationData *sim, float cfra)
        ParticleSystem *psys = sim->psys;
        ParticleSettings *part = psys->part;
        PARTICLE_P;
-       float disp = (float)psys_get_current_display_percentage(psys)/100.0f;
+       float disp = psys_get_current_display_percentage(psys);
 
        LOOP_PARTICLES {
                pa->size = part->size;
@@ -4388,7 +4388,7 @@ static void cached_step(ParticleSimulationData *sim, float cfra)
 
        psys_update_effectors(sim);
        
-       disp= (float)psys_get_current_display_percentage(psys)/100.0f;
+       disp= psys_get_current_display_percentage(psys);
 
        LOOP_PARTICLES {
                psys_get_texture(sim, pa, &ptex, PAMAP_SIZE, cfra);
@@ -4637,7 +4637,7 @@ static void system_step(ParticleSimulationData *sim, float cfra)
 
 /* 3. do dynamics */
        /* set particles to be not calculated TODO: can't work with pointcache */
-       disp= (float)psys_get_current_display_percentage(psys)/100.0f;
+       disp= psys_get_current_display_percentage(psys);
 
        LOOP_PARTICLES {
                if (PSYS_FRAND(p) > disp)
@@ -4933,7 +4933,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
                                case PART_PHYS_KEYED:
                                {
                                        PARTICLE_P;
-                                       float disp = (float)psys_get_current_display_percentage(psys)/100.0f;
+                                       float disp = psys_get_current_display_percentage(psys);
 
                                        /* Particles without dynamics haven't been reset yet because they don't use pointcache */
                                        if (psys->recalc & PSYS_RECALC_RESET)
diff --git a/source/blender/blenkernel/intern/script.c b/source/blender/blenkernel/intern/script.c
deleted file mode 100644 (file)
index 2d1577a..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * This is a new part of Blender.
- *
- * Contributor(s): Willian P. Germano.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/blenkernel/intern/script.c
- *  \ingroup bke
- */
-
-
-
-#include "MEM_guardedalloc.h"
-
-#if 0
-#ifdef WITH_PYTHON
-#include "BPY_extern.h" // Blender Python library
-#endif
-#endif
-
-/* XXX this function and so also the file should not be needed anymore,
- * since we have to force clearing all Python related data before freeing
- * Blender's library. Still testing, will decide later (Willian). */
-
index 9ae3c5cdfe153149b4ca00640857974752438f96..c073c716ec699f87c49e5817774840b2f6ccd3e9 100644 (file)
@@ -3889,7 +3889,7 @@ ImBuf *BKE_tracking_stabilize_frame(MovieTracking *tracking, int framenr, ImBuf
         * But need to keep an eye on this if the function will be
         * used in other cases.
         */
-       #pragma omp parallel for if(tmpibuf->y > 128)
+       #pragma omp parallel for if (tmpibuf->y > 128)
        for (j = 0; j < tmpibuf->y; j++) {
                int i;
                for (i = 0; i < tmpibuf->x; i++) {
index 0cbd4ee70b1f8789c6fe8b318d5e5ec0b6e56166..21197670640064f1d06fd60f9e18f4f23bb512d8 100644 (file)
@@ -115,7 +115,6 @@ void BLI_scanfill_end(ScanFillContext *sf_ctx);
 
 /* These callbacks are needed to make the lib finction properly */
 void BLI_setErrorCallBack(void (*f)(const char *));
-void BLI_setInterruptCallBack(int (*f)(void));
 
 #ifdef __cplusplus
 }
index d4a8b800f1710f776fca27d91437757274f5f29f..26fe0f21cd520d9ec4579d03e2b76ba5ad4bad14 100644 (file)
@@ -251,7 +251,7 @@ void *BLI_gzopen(const char *filename, const char *mode)
                        fclose(ufopen(filename, "a"));
 
                /* temporary #if until we update all libraries to 1.2.7
-                * for  correct wide char path handling */
+                * for correct wide char path handling */
 #if ZLIB_VERNUM >= 0x1270 && !defined(FREE_WINDOWS)
                UTF16_ENCODE(filename);
 
index cedec7d07b68fd3ce9a66c34d178e05605d51c2e..24497f8fb0603bda8f1864defd04bad507064085 100644 (file)
@@ -598,7 +598,7 @@ static void handleRadialSymmetry(BGraph *graph, BNode *root_node, int depth, flo
 
        /* sort ring by arc length
         * using a rather bogus insertion sort
-        * butrings will never get too big to matter
+        * but rings will never get too big to matter
         * */
        for (i = 0; i < total; i++) {
                int j;
index bef4e5adaaaa6d82754b5e9f334dcd7a86702647..4af1307c521c5f14d78446ef3da569af20ca6dc6 100644 (file)
@@ -78,7 +78,7 @@ MINLINE void linearrgb_to_srgb_uchar4(unsigned char srgb[4], const float linear[
        F4TOCHAR4(srgb_f, srgb);
 }
 
-/* predivide versions to work on associated/pre-multipled alpha. if this should
+/* predivide versions to work on associated/pre-multiplied alpha. if this should
  * be done or not depends on the background the image will be composited over,
  * ideally you would never do color space conversion on an image with alpha
  * because it is ill defined */
index a4e7424e5ddaafa8b8d8fc8ef590a3e3c2efd364..ddf1c598a1c5d483b53be372ff407965bb9248e7 100644 (file)
@@ -3621,7 +3621,7 @@ static float ff_quad_form_factor(float *p, float *n, float *q0, float *q1, float
 static __m128 sse_approx_acos(__m128 x)
 {
        /* needs a better approximation than taylor expansion of acos, since that
-        * gives big erros for near 1.0 values, sqrt(2 * x) * acos(1 - x) should work
+        * gives big errors for near 1.0 values, sqrt(2 * x) * acos(1 - x) should work
         * better, see http://www.tom.womack.net/projects/sse-fast-arctrig.html */
 
        return _mm_set_ps1(1.0f);
index 44a9ffa244d65bfed1afc96a1978f04702bc09d3..873ce302b9cf0167489fbd337cf8850c807b2c71 100644 (file)
@@ -45,7 +45,6 @@
 
 /* callbacks for errors and interrupts and some goo */
 static void (*BLI_localErrorCallBack)(const char *) = NULL;
-static int (*BLI_localInterruptCallBack)(void) = NULL;
 
 /**
  * Set a function taking a (char *) as argument to flag errors. If the
@@ -58,19 +57,6 @@ void BLI_setErrorCallBack(void (*f)(const char *))
        BLI_localErrorCallBack = f;
 }
 
-/**
- * Set a function to be able to interrupt the execution of processing
- * in this module. If the function returns true, the execution will
- * terminate gracefully. If the callback is not set, interruption is
- * not possible.
- * \param f The function to use as callback
- * \attention used in creator.c
- */
-void BLI_setInterruptCallBack(int (*f)(void))
-{
-       BLI_localInterruptCallBack = f;
-}
-
 /* just flush the error to /dev/null if the error handler is missing */
 void callLocalErrorCallBack(const char *msg)
 {
@@ -721,11 +707,8 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag)
                                                                        /* we continue searching and pick the one with sharpest corner */
                                                                        
                                                                        if (best_sc == NULL) {
+                                                                               /* even without holes we need to keep checking [#35861] */
                                                                                best_sc = sc1;
-                                                                               /* only need to continue checking with holes */
-                                                                               if ((flag & BLI_SCANFILL_CALC_HOLES) == 0) {
-                                                                                       break;
-                                                                               }
                                                                        }
                                                                        else {
                                                                                float angle;
index 07ed2f181112fb6be69e9d0d9e72d54247bbfe03..673cd3f7b2630d661b73dc99a9a473698a568576 100644 (file)
@@ -9331,7 +9331,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        }
 
        if (main->versionfile < 267) {
-               //if(!DNA_struct_elem_find(fd->filesdna, "Brush", "int", "stencil_pos")) {
+               //if (!DNA_struct_elem_find(fd->filesdna, "Brush", "int", "stencil_pos")) {
                Brush *brush;
 
                for (brush = main->brush.first; brush; brush = brush->id.next) {
index dc3a223ae5d1a48b728a4fbf151e3d6de412d7cb..8b5b95c5caec7c296b35f61aec2c8aa418ad762d 100644 (file)
@@ -520,7 +520,7 @@ const float *BM_edgeloop_center_get(struct BMEdgeLoopStore *el_store)
 #define NODE_AS_CO(n) ((BMVert *)((LinkData *)n)->data)->co
 
 /**
- * edges are assined to one vert -> the next.
+ * edges are assigned to one vert -> the next.
  */
 void BM_edgeloop_edges_get(struct BMEdgeLoopStore *el_store, BMEdge **e_arr)
 {
@@ -612,7 +612,7 @@ bool BM_edgeloop_calc_normal(BMesh *UNUSED(bm), BMEdgeLoopStore *el_store)
 }
 
 /**
- * For open loops that are stright lines,
+ * For open loops that are straight lines,
  * calculating the normal as if it were a polygon is meaningless.
  *
  * Instead use an alignment vector and calculate the normal based on that.
index e4d7a88dc83c0c0e7a6ad16db3ec75347a353554..b5535b59321aaac512f251e5126feefe57556b6c 100644 (file)
@@ -154,7 +154,7 @@ typedef void *(*BMIter__step_cb) (void *);
 
 /* Iterator Structure */
 /* note: some of these vars are not used,
- * so they have beem commented to save stack space since this struct is used all over */
+ * so they have been commented to save stack space since this struct is used all over */
 typedef struct BMIter {
        /* keep union first */
        union {
index 313d76721fa15bb3a9587994eb5e98f3f86e711b..dc7c13b3fe04d946adec3e5461834fe8ed21be7d 100644 (file)
@@ -555,12 +555,12 @@ void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
 }
 
 /* this replaces the active flag used in uv/face mode */
-void BM_active_face_set(BMesh *bm, BMFace *efa)
+void BM_mesh_active_face_set(BMesh *bm, BMFace *efa)
 {
        bm->act_face = efa;
 }
 
-BMFace *BM_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected)
+BMFace *BM_mesh_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected)
 {
        if (bm->act_face && (!is_selected || BM_elem_flag_test(bm->act_face, BM_ELEM_SELECT))) {
                return bm->act_face;
@@ -600,6 +600,45 @@ BMFace *BM_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_select
        return NULL;
 }
 
+BMEdge *BM_mesh_active_edge_get(BMesh *bm)
+{
+       if (bm->selected.last) {
+               BMEditSelection *ese = bm->selected.last;
+
+               if (ese && ese->htype == BM_EDGE) {
+                       return (BMEdge *)ese->ele;
+               }
+       }
+
+       return NULL;
+}
+
+BMVert *BM_mesh_active_vert_get(BMesh *bm)
+{
+       if (bm->selected.last) {
+               BMEditSelection *ese = bm->selected.last;
+
+               if (ese && ese->htype == BM_VERT) {
+                       return (BMVert *)ese->ele;
+               }
+       }
+
+       return NULL;
+}
+
+BMElem *BM_mesh_active_elem_get(BMesh *bm)
+{
+       if (bm->selected.last) {
+               BMEditSelection *ese = bm->selected.last;
+
+               if (ese) {
+                       return ese->ele;
+               }
+       }
+
+       return NULL;
+}
+
 /**
  * Generic way to get data from an EditSelection type
  * These functions were written to be used by the Modifier widget
@@ -763,7 +802,7 @@ void BM_select_history_validate(BMesh *bm)
 bool BM_select_history_active_get(BMesh *bm, BMEditSelection *ese)
 {
        BMEditSelection *ese_last = bm->selected.last;
-       BMFace *efa = BM_active_face_get(bm, false, false);
+       BMFace *efa = BM_mesh_active_face_get(bm, false, false);
 
        ese->next = ese->prev = NULL;
 
index a3d2d4a69851b98cb2474ae5ff7504eb465ccfd8..b7040e63458769ed7e565d0a35e50ac6e020bfdb 100644 (file)
@@ -70,8 +70,11 @@ int BM_mesh_elem_hflag_count_enabled(BMesh *bm, const char htype, const char hfl
 int BM_mesh_elem_hflag_count_disabled(BMesh *bm, const char htype, const char hflag, const bool respecthide);
 
 /* edit selection stuff */
-void    BM_active_face_set(BMesh *bm, BMFace *f);
-BMFace *BM_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected);
+void    BM_mesh_active_face_set(BMesh *bm, BMFace *f);
+BMFace *BM_mesh_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected);
+BMEdge *BM_mesh_active_edge_get(BMesh *bm);
+BMVert *BM_mesh_active_vert_get(BMesh *bm);
+BMElem *BM_mesh_active_elem_get(BMesh *bm);
 
 void    BM_editselection_center(BMEditSelection *ese, float r_center[3]);
 void    BM_editselection_normal(BMEditSelection *ese, float r_normal[3]);
index 9d330075a3ae7d79c6cc7fe9bbba7e03e3d97c0f..7c4af8eaa3b745ed00782c5f96dac451904b53ce 100644 (file)
 #include "bmesh.h"
 #include "intern/bmesh_private.h" /* for element checking */
 
+/**
+ * Currently this is only used for Python scripts
+ * which may fail to keep matching UV/TexFace layers.
+ *
+ * \note This should only perform any changes in exceptional cases,
+ * if we need this to be faster we could inline #BM_data_layer_add and only
+ * call #update_data_blocks once at the end.
+ */
+void BM_mesh_cd_validate(BMesh *bm)
+{
+       int totlayer_mtex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
+       int totlayer_uv = CustomData_number_of_layers(&bm->ldata, CD_MLOOPUV);
+
+       if (LIKELY(totlayer_mtex == totlayer_uv)) {
+               /* pass */
+       }
+       else if (totlayer_mtex < totlayer_uv) {
+               const int uv_index_first = CustomData_get_layer_index(&bm->ldata, CD_MLOOPUV);
+               do {
+                       const char *from_name =  bm->ldata.layers[uv_index_first + totlayer_mtex].name;
+                       BM_data_layer_add_named(bm, &bm->pdata, CD_MTEXPOLY, from_name);
+                       CustomData_set_layer_unique_name(&bm->pdata, totlayer_mtex);
+               } while (totlayer_uv != ++totlayer_mtex);
+       }
+       else if (totlayer_uv < totlayer_mtex) {
+               const int mtex_index_first = CustomData_get_layer_index(&bm->pdata, CD_MTEXPOLY);
+               do {
+                       const char *from_name = bm->pdata.layers[mtex_index_first + totlayer_uv].name;
+                       BM_data_layer_add_named(bm, &bm->ldata, CD_MLOOPUV, from_name);
+                       CustomData_set_layer_unique_name(&bm->ldata, totlayer_uv);
+               } while (totlayer_mtex != ++totlayer_uv);
+       }
+
+       BLI_assert(totlayer_mtex == totlayer_uv);
+}
+
 void BM_mesh_cd_flag_ensure(BMesh *bm, Mesh *mesh, const char cd_flag)
 {
        const char cd_flag_all = BM_mesh_cd_flag_from_bmesh(bm) | cd_flag;
index 754ae8bcad40689643b00c9cd76252bcc0624af7..ab9d7a0ccf3ceff3a6ad0996dfa6c85b4c634840 100644 (file)
@@ -34,6 +34,7 @@
 
 struct Mesh;
 
+void BM_mesh_cd_validate(BMesh *bm);
 void BM_mesh_cd_flag_ensure(BMesh *bm, struct Mesh *mesh, const char cd_flag);
 void BM_mesh_cd_flag_apply(BMesh *bm, const char cd_flag);
 char BM_mesh_cd_flag_from_bmesh(BMesh *bm);
index 79e097a7a7c583993c6be98132835d6113bc59de..04edec01a5c3c05092fb91b13ff75a3fa190ef05 100644 (file)
@@ -40,7 +40,7 @@
  * - joeedh -
  * design notes:
  *
- * original desing: walkers directly emulation recursive functions.
+ * original design: walkers directly emulation recursive functions.
  * functions save their state onto a worklist, and also add new states
  * to implement recursive or looping behavior.  generally only one
  * state push per call with a specific state is desired.
index f1c400574f51b9c8fdbd7e999ade6b92a4a1b1ad..2c0bc7f95d9bd2f44a44edbcd0dbac3bf111d3b3 100644 (file)
 /** \file blender/bmesh/operators/bmo_beautify.c
  *  \ingroup bmesh
  *
- * Beautify the mesh by rotating edes between triangles
+ * Beautify the mesh by rotating edges between triangles
  * to more attractive positions until no more rotations can be made.
  *
- * In princible this is very simple however there is the possability of
+ * In principle this is very simple however there is the possibility of
  * going into an eternal loop where edges keep rotating.
  * To avoid this - each edge stores a hash of it previous
  * states so as not to rotate back.
index 116fe46ee53b262d8015c420c0d55bf8f52eeb98..a517b7af5021844810c63f4b1d5a97d5c96e88cd 100644 (file)
@@ -363,7 +363,7 @@ static void bridge_loop_pair(BMesh *bm,
                int i;
 
                BMOperator op_sub;
-               /* when we have to bridge betweeen different sized edge-loops,
+               /* when we have to bridge between different sized edge-loops,
                 * be clever and post-process for best results */
 
 
index 2d78a02f7097dcfaa4ad38450aa42201014daa83..e41fbd69616eeed86153544632d2bc5d0d411696 100644 (file)
@@ -23,7 +23,7 @@
 /** \file blender/bmesh/operators/bmo_dupe.c
  *  \ingroup bmesh
  *
- * Duplicate, Split, Spint operators.
+ * Duplicate, Split, Split operators.
  */
 
 #include "MEM_guardedalloc.h"
index cd35ea679149afc4ecba4c636a108e3d8ae187e4..f1bf3179cd6aca0a4a2d82dd806cd31e278a9fb7 100644 (file)
@@ -92,12 +92,11 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op)
                BMFace *f;
                BMLoop *l;
                MLoopUV *luv;
-               int totlayer;
+               const int totlayer = CustomData_number_of_layers(&bm->ldata, CD_MLOOPUV);
                BMIter liter;
 
                BMO_ITER (f, &siter, dupeop.slots_out, "geom.out", BM_FACE) {
                        BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
-                               totlayer = CustomData_number_of_layers(&bm->ldata, CD_MLOOPUV);
                                for (i = 0; i < totlayer; i++) {
                                        luv = CustomData_bmesh_get_n(&bm->ldata, l->head.data, CD_MLOOPUV, i);
                                        if (mirror_u)
index 7105210da046bbd26a5d248daa3e1146eb9c60c2..03084ebb1b66c34cc7cceded3381b1fb57062803 100644 (file)
@@ -73,7 +73,7 @@ void bmo_poke_exec(BMesh *bm, BMOperator *op)
                float f_center[3];
                BMVert *v_center = NULL;
                BMLoop *l_iter, *l_first;
-               /* only interpolate the centeral loop from the face once,
+               /* only interpolate the central loop from the face once,
                 * then copy to all others in the fan */
                BMLoop *l_center_example;
 
index 6b5e18ceb61529aedbc27b3b369116805e064026..a2cbb0fe44c294594c157cb1df9d59c8d5cd387f 100644 (file)
@@ -223,7 +223,7 @@ static BevVert *find_bevvert(BevelParams *bp, BMVert *bmv)
        return BLI_ghash_lookup(bp->vert_hash, bmv);
 }
 
-/* Return a good respresentative face (for materials, etc.) for faces
+/* Return a good representative face (for materials, etc.) for faces
  * created around/near BoundVert v */
 static BMFace *boundvert_rep_face(BoundVert *v)
 {
@@ -531,7 +531,7 @@ static int bev_ccw_test(BMEdge *a, BMEdge *b, BMFace *f)
  * Also find vd, which is in direction normal to parallelogram and 1 unit away
  * from the origin.
  * The quarter circle in first quadrant of unit square will be mapped to the
- * quadrant of a sheared ellipse in the parallelgram, using a matrix.
+ * quadrant of a sheared ellipse in the parallelogram, using a matrix.
  * The matrix mat is calculated to map:
  *    (0,1,0) -> va
  *    (1,1,0) -> vmid
index f47abc8891cd02de37a90e438dbb00a643e108bc..d3ffc3485392244970d7c75dda2339a076f5cac1 100644 (file)
@@ -116,7 +116,7 @@ static void bm_decim_build_quadrics(BMesh *bm, Quadric *vquadrics)
 static void bm_decim_calc_target_co(BMEdge *e, float optimize_co[3],
                                     const Quadric *vquadrics)
 {
-       /* compute an edge contration target for edge 'e'
+       /* compute an edge contraction target for edge 'e'
         * this is computed by summing it's vertices quadrics and
         * optimizing the result. */
        Quadric q;
@@ -682,7 +682,7 @@ static bool bm_edge_collapse_is_degenerate_topology(BMEdge *e_first)
 
 /**
  * special, highly limited edge collapse function
- * intended for speed over flexibiliy.
+ * intended for speed over flexibility.
  * can only collapse edges connected to (1, 2) tris.
  *
  * Important - dont add vert/edge/face data on collapsing!
index c48e83686b5090d9a4d1b290e8b361e52904bbf7..0667d560615e63ee08a0fb5f9835abe861c55e18 100644 (file)
@@ -79,7 +79,7 @@ static bool bm_vert_dissolve_fan(BMesh *bm, BMVert *v)
 {
        /* collapse under 2 conditions.
         * - vert connects to 4 manifold edges (and 4 faces).
-        * - vert connecrs to 1 manifold edge, 2 boundary edges (and 2 faces).
+        * - vert connects to 1 manifold edge, 2 boundary edges (and 2 faces).
         *
         * This covers boundary verts of a quad grid and center verts.
         * note that surrounding faces dont have to be quads.
index 19a49c4344d65d90da255d99314b8876645a5a6c..bcbcdd42752b2819960f4cdb29bedfc222e3df0a 100644 (file)
@@ -924,7 +924,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj
        bPoseChannel *parchan = NULL;
        bPoseChannel *pchan = NULL;
 
-       if (ob->type == OB_ARMATURE ) {
+       if (ob->type == OB_ARMATURE && bone) {
                bPose *pose = ob->pose;
                pchan = BKE_pose_channel_find_name(pose, bone->name);
                if (!pchan)
index a6f1b89aedb21874e10bbac1832214d9cd855803..ea5fd203bea3ef671e2a27b1472ca3370443fe60 100644 (file)
@@ -35,6 +35,7 @@ extern "C"
 #include "DNA_armature_types.h"
 #include "DNA_material_types.h"
 #include "DNA_constraint_types.h"
+#include "DNA_scene_types.h"
 
 #include "BLI_math.h"
 #include "BLI_string.h"
index 95baab05e3af3c6e7d588e225c664f22be99505a..c2770dc3dc56378f9d9f00201d6808c2f7a60a52 100644 (file)
@@ -37,6 +37,7 @@
 #include "BKE_object.h"
 #include "DNA_armature_types.h"
 #include "DNA_modifier_types.h"
+#include "DNA_scene_types.h"
 #include "ED_mesh.h"
 #include "ED_object.h"
 #include "BKE_action.h"
index c0388438a98e684709c5310d7f506956f5d8a4c5..073b100e156d5e7d6604a84c0791e157a4e96c96 100644 (file)
@@ -28,7 +28,9 @@
 Import ('env')
 defs = ['GLEW_STATIC']
 
-sources = env.Glob('intern/*.cpp') + env.Glob('nodes/*.cpp') + env.Glob('operations/*.cpp')
+sources_intern = env.Glob('intern/*.cpp')
+sources_nodes = env.Glob('nodes/*.cpp')
+sources_operations = env.Glob('operations/*.cpp')
 
 incs = [
     '.',
@@ -56,4 +58,13 @@ incs = [
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
     incs.append(env['BF_PTHREADS_INC'])
 
-env.BlenderLib('bf_composite', sources, incs, defines=defs, libtype=['core'], priority=[164])
+if False: # gives link errors 'win' in env['OURPLATFORM']:
+    # split into 3 modules to work around command length limit on Windows
+    env.BlenderLib('bf_composite_intern', sources_intern, incs, defines=defs, libtype=['core'], priority=[166])
+    env.BlenderLib('bf_composite_nodes', sources_nodes, incs, defines=defs, libtype=['core'], priority=[165])
+    env.BlenderLib('bf_composite_operations', sources_operations, incs, defines=defs, libtype=['core'], priority=[164])
+else:
+    sources = sources_intern + sources_nodes + sources_operations
+    env.BlenderLib('bf_composite', sources, incs, defines=defs, libtype=['core'], priority=[164])
+
+
index 03b7697ecfa40eddd5da9152ddca6a8286adf9ee..5b525a089b31138fb86a71ed7aa7da8f0b8c883c 100644 (file)
@@ -34,6 +34,7 @@
 
 
 #include "DNA_curve_types.h"
+#include "DNA_scene_types.h"
 
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
index 1ee3ae1283d6165c527fccdedb07ea09b070b198..3e0269aa13818749d6ee6237e376afa5c767d2d0 100644 (file)
@@ -74,7 +74,6 @@ struct Object;
 struct rcti;
 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,
@@ -313,6 +312,11 @@ bool ED_mesh_pick_vert(struct bContext *C,      struct Object *ob, const int mva
 bool ED_mesh_pick_face(struct bContext *C,      struct Object *ob, const int mval[2], unsigned int *index, int size);
 bool ED_mesh_pick_face_vert(struct bContext *C, struct Object *ob, const int mval[2], unsigned int *index, int size);
 
+
+struct MDeformVert *ED_mesh_active_dvert_get_em(struct Object *ob, struct BMVert **r_eve);
+struct MDeformVert *ED_mesh_active_dvert_get_ob(struct Object *ob, int *r_index);
+struct MDeformVert *ED_mesh_active_dvert_get_only(struct Object *ob);
+
 #define ED_MESH_PICK_DEFAULT_VERT_SIZE 50
 #define ED_MESH_PICK_DEFAULT_FACE_SIZE 3
 
index e891f6487131d05e3275ede3386b19644fa6d855..90b131e5acc5a6fc6e912354a688f06cf7b2d1cb 100644 (file)
@@ -69,8 +69,6 @@ struct PointerRNA;
 struct PropertyRNA;
 struct EnumPropertyItem;
 
-enum eVGroupSelect;
-
 /* object_edit.c */
 struct Object *ED_object_context(struct bContext *C);               /* context.object */
 struct Object *ED_object_active_context(struct bContext *C); /* context.object or context.active_object */
index 12030f7da806579b5695ca9a58ad76d6779a8db1..d80e40d245599fbf844d859b8835c149f8a135f8 100644 (file)
@@ -50,7 +50,7 @@ struct uiBlock;
 struct rcti;
 
 /* regions */
-void    ED_region_do_listen(struct ARegion *ar, struct wmNotifier *note);
+void    ED_region_do_listen(struct bScreen *sc, struct ScrArea *sa, struct ARegion *ar, struct wmNotifier *note);
 void    ED_region_do_draw(struct bContext *C, struct ARegion *ar);
 void    ED_region_exit(struct bContext *C, struct ARegion *ar);
 void    ED_region_pixelspace(struct ARegion *ar);
@@ -80,7 +80,7 @@ int     ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock
 void    ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *sa);
 void    ED_area_exit(struct bContext *C, struct ScrArea *sa);
 int     ED_screen_area_active(const struct bContext *C);
-void    ED_area_do_listen(ScrArea *sa, struct wmNotifier *note);
+void    ED_area_do_listen(struct bScreen *sc, ScrArea *sa, struct wmNotifier *note);
 void    ED_area_tag_redraw(ScrArea *sa);
 void    ED_area_tag_redraw_regiontype(ScrArea *sa, int type);
 void    ED_area_tag_refresh(ScrArea *sa);
index 86e51b201d9dd79390655b93c7af0a348889c843..b997d0ef6a0e4e9a6ac9e2500b2f6f0b9bdb9f2c 100644 (file)
@@ -95,84 +95,88 @@ typedef struct uiLayout uiLayout;
 #define UI_EMBOSST      3   /* Table */
 
 /* uiBlock->direction */
-#define UI_DIRECTION    (UI_TOP | UI_DOWN | UI_LEFT | UI_RIGHT)
-#define UI_TOP      1
-#define UI_DOWN     2
-#define UI_LEFT     4
-#define UI_RIGHT    8
-
-#define UI_CENTER       16
-#define UI_SHIFT_FLIPPED    32
-
+#define UI_DIRECTION       (UI_TOP | UI_DOWN | UI_LEFT | UI_RIGHT)
+#define UI_TOP             (1 << 0)
+#define UI_DOWN            (1 << 1)
+#define UI_LEFT            (1 << 2)
+#define UI_RIGHT           (1 << 3)
+#define UI_CENTER          (1 << 4)
+#define UI_SHIFT_FLIPPED   (1 << 5)
+
+#if 0
 /* uiBlock->autofill (not yet used) */
-// #define UI_BLOCK_COLLUMNS   1
-// #define UI_BLOCK_ROWS               2
+#define UI_BLOCK_COLLUMNS  1
+#define UI_BLOCK_ROWS      2
+#endif
 
 /* uiBlock->flag (controls) */
-#define UI_BLOCK_LOOP           1
-#define UI_BLOCK_REDRAW         2
-#define UI_BLOCK_SEARCH_MENU    4
-#define UI_BLOCK_NUMSELECT      8
-#define UI_BLOCK_NO_WIN_CLIP    16      /* don't apply window clipping */ /* was UI_BLOCK_ENTER_OK */
-#define UI_BLOCK_CLIPBOTTOM     32
-#define UI_BLOCK_CLIPTOP        64
-#define UI_BLOCK_MOVEMOUSE_QUIT 128
-#define UI_BLOCK_KEEP_OPEN      256
-#define UI_BLOCK_POPUP          512
-#define UI_BLOCK_OUT_1          1024
-#define UI_BLOCK_NO_FLIP        2048
-#define UI_BLOCK_POPUP_MEMORY   4096
-#define UI_BLOCK_CLIP_EVENTS    8192    /* stop handling mouse events */
+#define UI_BLOCK_LOOP           (1 << 0)
+#define UI_BLOCK_REDRAW         (1 << 1)
+#define UI_BLOCK_SEARCH_MENU    (1 << 2)
+#define UI_BLOCK_NUMSELECT      (1 << 3)
+#define UI_BLOCK_NO_WIN_CLIP    (1 << 4)   /* don't apply window clipping */ /* was UI_BLOCK_ENTER_OK */
+#define UI_BLOCK_CLIPBOTTOM     (1 << 5)
+#define UI_BLOCK_CLIPTOP        (1 << 6)
+#define UI_BLOCK_MOVEMOUSE_QUIT (1 << 7)
+#define UI_BLOCK_KEEP_OPEN      (1 << 8)
+#define UI_BLOCK_POPUP          (1 << 9)
+#define UI_BLOCK_OUT_1          (1 << 10)
+#define UI_BLOCK_NO_FLIP        (1 << 11)
+#define UI_BLOCK_POPUP_MEMORY   (1 << 12)
+#define UI_BLOCK_CLIP_EVENTS    (1 << 13)  /* stop handling mouse events */
+
+/* XXX This comment is no more valid! Maybe it is now bits 14-17? */
+/* block->flag bits 12-15 are identical to but->flag bits */
 
-/* uiPopupBlockHandle->menuretval */
-#define UI_RETURN_CANCEL     1       /* cancel all menus cascading */
-#define UI_RETURN_OK         2       /* choice made */
-#define UI_RETURN_OUT        4       /* left the menu */
-#define UI_RETURN_OUT_PARENT 8       /* let the parent handle this event */
-#define UI_RETURN_UPDATE     16      /* update the button that opened */
-#define UI_RETURN_POPUP_OK   32      /* popup is ok to be handled */
+#define UI_BLOCK_LIST_ITEM   (1 << 19)
 
-/* block->flag bits 12-15 are identical to but->flag bits */
+/* uiPopupBlockHandle->menuretval */
+#define UI_RETURN_CANCEL     (1 << 0)   /* cancel all menus cascading */
+#define UI_RETURN_OK         (1 << 1)   /* choice made */
+#define UI_RETURN_OUT        (1 << 2)   /* left the menu */
+#define UI_RETURN_OUT_PARENT (1 << 3)   /* let the parent handle this event */
+#define UI_RETURN_UPDATE     (1 << 4)   /* update the button that opened */
+#define UI_RETURN_POPUP_OK   (1 << 5)   /* popup is ok to be handled */
 
 /* panel controls */
-#define UI_PNL_SOLID    2
-#define UI_PNL_CLOSE    32
-#define UI_PNL_SCALE    512
+#define UI_PNL_SOLID    (1 << 1)
+#define UI_PNL_CLOSE    (1 << 5)
+#define UI_PNL_SCALE    (1 << 9)
 
 /* warning the first 6 flags are internal */
 /* but->flag */
-#define UI_TEXT_LEFT    64
-#define UI_ICON_LEFT    128
-#define UI_ICON_SUBMENU 256
-#define UI_ICON_PREVIEW 512
+#define UI_TEXT_LEFT         (1 << 6)
+#define UI_ICON_LEFT         (1 << 7)
+#define UI_ICON_SUBMENU      (1 << 8)
+#define UI_ICON_PREVIEW      (1 << 9)
 
-#define UI_TEXT_RIGHT       1024
-#define UI_BUT_NODE_LINK    2048
-#define UI_BUT_NODE_ACTIVE  4096
-#define UI_BUT_DRAG_LOCK    8192
+#define UI_TEXT_RIGHT        (1 << 10)
+#define UI_BUT_NODE_LINK     (1 << 11)
+#define UI_BUT_NODE_ACTIVE   (1 << 12)
+#define UI_BUT_DRAG_LOCK     (1 << 13)
 
 /* button align flag, for drawing groups together */
-#define UI_BUT_ALIGN        (UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_LEFT | UI_BUT_ALIGN_RIGHT | UI_BUT_ALIGN_DOWN)
-#define UI_BUT_ALIGN_TOP    (1 << 14)
-#define UI_BUT_ALIGN_LEFT   (1 << 15)
-#define UI_BUT_ALIGN_RIGHT  (1 << 16)
-#define UI_BUT_ALIGN_DOWN   (1 << 17)
-
-#define UI_BUT_DISABLED     (1 << 18)
-#define UI_BUT_COLOR_LOCK   (1 << 19)
-#define UI_BUT_ANIMATED     (1 << 20)
-#define UI_BUT_ANIMATED_KEY (1 << 21)
-#define UI_BUT_DRIVEN       (1 << 22)
-#define UI_BUT_REDALERT     (1 << 23)
-#define UI_BUT_INACTIVE     (1 << 24)
-#define UI_BUT_LAST_ACTIVE  (1 << 25)
-#define UI_BUT_UNDO         (1 << 26)
-#define UI_BUT_IMMEDIATE    (1 << 27)
-#define UI_BUT_NO_TOOLTIP   (1 << 28)
-#define UI_BUT_NO_UTF8      (1 << 29)
+#define UI_BUT_ALIGN         (UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_LEFT | UI_BUT_ALIGN_RIGHT | UI_BUT_ALIGN_DOWN)
+#define UI_BUT_ALIGN_TOP     (1 << 14)
+#define UI_BUT_ALIGN_LEFT    (1 << 15)
+#define UI_BUT_ALIGN_RIGHT   (1 << 16)
+#define UI_BUT_ALIGN_DOWN    (1 << 17)
+
+#define UI_BUT_DISABLED      (1 << 18)
+#define UI_BUT_COLOR_LOCK    (1 << 19)
+#define UI_BUT_ANIMATED      (1 << 20)
+#define UI_BUT_ANIMATED_KEY  (1 << 21)
+#define UI_BUT_DRIVEN        (1 << 22)
+#define UI_BUT_REDALERT      (1 << 23)
+#define UI_BUT_INACTIVE      (1 << 24)
+#define UI_BUT_LAST_ACTIVE   (1 << 25)
+#define UI_BUT_UNDO          (1 << 26)
+#define UI_BUT_IMMEDIATE     (1 << 27)
+#define UI_BUT_NO_TOOLTIP    (1 << 28)
+#define UI_BUT_NO_UTF8       (1 << 29)
 
 #define UI_BUT_VEC_SIZE_LOCK (1 << 30) /* used to flag if color hsv-circle should keep luminance */
-#define UI_BUT_COLOR_CUBIC  (1 << 31) /* cubic saturation for the color wheel */
+#define UI_BUT_COLOR_CUBIC   (1 << 31) /* cubic saturation for the color wheel */
 
 #define UI_PANEL_WIDTH          340
 #define UI_COMPACT_PANEL_WIDTH  160
@@ -249,7 +253,8 @@ typedef enum {
        VECTORSCOPE   = (50 << 9),
        PROGRESSBAR   = (51 << 9),
        SEARCH_MENU_UNLINK   = (52 << 9),
-       NODESOCKET    = (53 << 9)
+       NODESOCKET    = (53 << 9),
+       LISTLABEL     = (54 << 9),
 } eButType;
 
 #define BUTTYPE     (63 << 9)
@@ -279,9 +284,9 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
 void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight);
 
 /* state for scrolldrawing */
-#define UI_SCROLL_PRESSED       1
-#define UI_SCROLL_ARROWS        2
-#define UI_SCROLL_NO_OUTLINE    4
+#define UI_SCROLL_PRESSED       (1 << 0)
+#define UI_SCROLL_ARROWS        (1 << 1)
+#define UI_SCROLL_NO_OUTLINE    (1 << 2)
 void uiWidgetScrollDraw(struct uiWidgetColors *wcol, const struct rcti *rect, const struct rcti *slider, int state);
 
 /* Callbacks
@@ -556,18 +561,18 @@ void uiButGetStrInfo(struct bContext *C, uiBut *but, ...);
  * - PickerButtons: buttons like the color picker (for code sharing).
  * - AutoButR: RNA property button with type automatically defined. */
 
-#define UI_ID_RENAME        1
-#define UI_ID_BROWSE        2
-#define UI_ID_ADD_NEW       4
-#define UI_ID_OPEN          8
-#define UI_ID_ALONE         16
-#define UI_ID_DELETE        32
-#define UI_ID_LOCAL         64
-#define UI_ID_AUTO_NAME     128
-#define UI_ID_FAKE_USER     256
-#define UI_ID_PIN           512
-#define UI_ID_BROWSE_RENDER 1024
-#define UI_ID_PREVIEWS      2048
+#define UI_ID_RENAME        (1 << 0)
+#define UI_ID_BROWSE        (1 << 1)
+#define UI_ID_ADD_NEW       (1 << 2)
+#define UI_ID_OPEN          (1 << 3)
+#define UI_ID_ALONE         (1 << 4)
+#define UI_ID_DELETE        (1 << 5)
+#define UI_ID_LOCAL         (1 << 6)
+#define UI_ID_AUTO_NAME     (1 << 7)
+#define UI_ID_FAKE_USER     (1 << 8)
+#define UI_ID_PIN           (1 << 9)
+#define UI_ID_BROWSE_RENDER (1 << 10)
+#define UI_ID_PREVIEWS      (1 << 11)
 #define UI_ID_FULL          (UI_ID_RENAME | UI_ID_BROWSE | UI_ID_ADD_NEW | UI_ID_OPEN | UI_ID_ALONE | UI_ID_DELETE | UI_ID_LOCAL)
 
 int uiIconFromID(struct ID *id);
@@ -708,15 +713,15 @@ void UI_exit(void);
 #define UI_LAYOUT_ALIGN_CENTER  2
 #define UI_LAYOUT_ALIGN_RIGHT   3
 
-#define UI_ITEM_O_RETURN_PROPS  1
-#define UI_ITEM_R_EXPAND        2
-#define UI_ITEM_R_SLIDER        4
-#define UI_ITEM_R_TOGGLE        8
-#define UI_ITEM_R_ICON_ONLY     16
-#define UI_ITEM_R_EVENT         32
-#define UI_ITEM_R_FULL_EVENT    64
-#define UI_ITEM_R_NO_BG         128
-#define UI_ITEM_R_IMMEDIATE     256
+#define UI_ITEM_O_RETURN_PROPS  (1 << 0)
+#define UI_ITEM_R_EXPAND        (1 << 1)
+#define UI_ITEM_R_SLIDER        (1 << 2)
+#define UI_ITEM_R_TOGGLE        (1 << 3)
+#define UI_ITEM_R_ICON_ONLY     (1 << 4)
+#define UI_ITEM_R_EVENT         (1 << 5)
+#define UI_ITEM_R_FULL_EVENT    (1 << 6)
+#define UI_ITEM_R_NO_BG         (1 << 7)
+#define UI_ITEM_R_IMMEDIATE     (1 << 8)
 
 /* uiLayoutOperatorButs flags */
 #define UI_LAYOUT_OP_SHOW_TITLE 1
@@ -729,13 +734,13 @@ void UI_exit(void);
  * 8------4 */
 
 enum {
-       UI_CNR_TOP_LEFT = 1,
-       UI_CNR_TOP_RIGHT = 2,
-       UI_CNR_BOTTOM_RIGHT = 4,
-       UI_CNR_BOTTOM_LEFT = 8,
+       UI_CNR_TOP_LEFT     = (1 << 0),
+       UI_CNR_TOP_RIGHT    = (1 << 1),
+       UI_CNR_BOTTOM_RIGHT = (1 << 2),
+       UI_CNR_BOTTOM_LEFT  = (1 << 3),
        /* just for convenience */
-       UI_CNR_NONE = 0,
-       UI_CNR_ALL = (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)
+       UI_CNR_NONE         = 0,
+       UI_CNR_ALL          = (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)
 };
 
 /* not apart of the corner flags but mixed in some functions  */
index 7aee228ddaabdfd229227f6edc21a64f9d4d3df5..d86f22df4a798fb2cf097420c9dfba8d599b1b6a 100644 (file)
@@ -276,7 +276,7 @@ void ui_pan_to_scroll(const wmEvent *event, int *type, int *val)
 
 static bool ui_but_editable(uiBut *but)
 {
-       return ELEM5(but->type, LABEL, SEPR, ROUNDBOX, LISTBOX, PROGRESSBAR);
+       return ELEM6(but->type, LABEL, LISTLABEL, SEPR, ROUNDBOX, LISTBOX, PROGRESSBAR);
 }
 
 static uiBut *ui_but_prev(uiBut *but)
@@ -2010,7 +2010,7 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
        uiBut *but;
 
        /* label and roundbox can overlap real buttons (backdrops...) */
-       if (ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX))
+       if (ELEM5(actbut->type, LABEL, LISTLABEL, SEPR, ROUNDBOX, LISTBOX))
                return;
 
        for (but = actbut->next; but; but = but->next) {
@@ -2038,7 +2038,7 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa
        uiBut *but;
 
        /* label and roundbox can overlap real buttons (backdrops...) */
-       if (ELEM4(actbut->type, LABEL, SEPR, ROUNDBOX, LISTBOX))
+       if (ELEM5(actbut->type, LABEL, LISTLABEL, SEPR, ROUNDBOX, LISTBOX))
                return;
 
        for (but = actbut->prev; but; but = but->prev) {
@@ -5361,6 +5361,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
                case ROUNDBOX:
                case LISTBOX:
                case LABEL:
+               case LISTLABEL:
                case ROW:
                case LISTROW:
                case BUT_IMAGE:
@@ -5558,7 +5559,7 @@ static bool ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y)
 bool ui_is_but_interactive(uiBut *but)
 {
        /* note, LABEL is included for highlights, this allows drags */
-       if (but->type == LABEL && but->dragpoin == NULL)
+       if (ELEM(but->type, LABEL, LISTLABEL) && but->dragpoin == NULL)
                return false;
        if (ELEM3(but->type, ROUNDBOX, SEPR, LISTBOX))
                return false;
@@ -6995,7 +6996,7 @@ static int ui_handle_menu_event(bContext *C, const wmEvent *event, uiPopupBlockH
                                                for (but = block->buttons.first; but; but = but->next) {
                                                        int doit = FALSE;
                                                        
-                                                       if (but->type != LABEL && but->type != SEPR)
+                                                       if (but->type != LABEL && but->type != LISTLABEL && but->type != SEPR)
                                                                count++;
                                                        
                                                        /* exception for rna layer buts */
index a6076b8df78bcc0a84efb6ecbe8740e13e390e94..82352cee05e9efec7ebc0b80dea78d7379b13d11 100644 (file)
@@ -94,7 +94,8 @@ typedef enum {
        UI_WTYPE_BOX,
        UI_WTYPE_SCROLL,
        UI_WTYPE_LISTITEM,
-       UI_WTYPE_PROGRESSBAR
+       UI_WTYPE_PROGRESSBAR,
+       UI_WTYPE_LISTLABEL,
 } uiWidgetTypeEnum;
 
 /* menu scrolling */
@@ -563,6 +564,7 @@ void ui_layout_add_but(uiLayout *layout, uiBut *but);
 int ui_but_can_align(uiBut *but);
 void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop);
 void ui_but_add_shortcut(uiBut *but, const char *key_str, const bool do_strip);
+void ui_layout_list_set_labels_active(uiLayout *layout);
 
 /* interface_anim.c */
 void ui_but_anim_flag(uiBut *but, float cfra);
index ef839f1d14359f1ac70b2dec3fa1a892d10f988c..2a6a9600582f201b943b857cdd9109ccccbca604 100644 (file)
@@ -1632,7 +1632,7 @@ static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon)
                but = uiDefIconBut(block, LABEL, 0, icon, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
        else
                but = uiDefBut(block, LABEL, 0, name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
-       
+
        /* to compensate for string size padding in ui_text_icon_width,
         * make text aligned right if the layout is aligned right.
         */
@@ -1640,7 +1640,12 @@ static uiBut *uiItemL_(uiLayout *layout, const char *name, int icon)
                but->flag &= ~UI_TEXT_LEFT;     /* default, needs to be unset */
                but->flag |= UI_TEXT_RIGHT;
        }
-       
+
+       /* Mark as a label inside a listbox. */
+       if (block->flag & UI_BLOCK_LIST_ITEM) {
+               but->type = LISTLABEL;
+       }
+
        return but;
 }
 
@@ -1749,7 +1754,7 @@ void uiItemMenuEnumO(uiLayout *layout, bContext *C, const char *opname, const ch
 
        /* add hotkey here, lower UI code can't detect it */
        if (layout->root->block->flag & UI_BLOCK_LOOP) {
-               if (ot->prop &&
+               if (ot->prop && ot->invoke &&
                    WM_key_event_operator_string(C, ot->idname, layout->root->opcontext, NULL, false, keybuf, sizeof(keybuf)))
                {
                        namestr += BLI_snprintf(namestr, sizeof(namestr_buf) - (namestr - namestr_buf), "|%s", keybuf);
@@ -2399,6 +2404,18 @@ uiLayout *uiLayoutBox(uiLayout *layout)
        return (uiLayout *)ui_layout_box(layout, ROUNDBOX);
 }
 
+/* Check all buttons defined in this layout, and set labels as active/selected.
+ * Needed to handle correctly text colors of list items. */
+void ui_layout_list_set_labels_active(uiLayout *layout)
+{
+       uiButtonItem *bitem;
+       for (bitem = layout->items.first; bitem; bitem = bitem->item.next) {
+               if (bitem->item.type == ITEM_BUTTON && bitem->but->type == LISTLABEL) {
+                       uiButSetFlag(bitem->but, UI_SELECT);
+               }
+       }
+}
+
 uiLayout *uiLayoutListBox(uiLayout *layout, uiList *ui_list, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *actptr,
                           PropertyRNA *actprop)
 {
index ca26044f6628063cbacc0c37b2f90b73067dfadf..b13de64d0c7e48613798b6df527182f03bc69710 100644 (file)
@@ -472,8 +472,10 @@ static void ui_draw_aligned_panel_header(uiStyle *style, uiBlock *block, rcti *r
        const char *activename = panel->drawname[0] ? panel->drawname : panel->panelname;
 
        /* + 0.001f to avoid flirting with float inaccuracy */
-       if (panel->control & UI_PNL_CLOSE) pnl_icons = (panel->labelofs + 2 * PNL_ICON + 5) / block->aspect + 0.001f;
-       else pnl_icons = (panel->labelofs + PNL_ICON + 5) / block->aspect + 0.001f;
+       if (panel->control & UI_PNL_CLOSE)
+               pnl_icons = (panel->labelofs + 2 * PNL_ICON + 5) / block->aspect + 0.001f;
+       else
+               pnl_icons = (panel->labelofs + PNL_ICON + 5) / block->aspect + 0.001f;
        
        /* active tab */
        /* draw text label */
@@ -514,7 +516,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
        rcti headrect;
        rctf itemrect;
        int ofsx;
-       
+
        if (panel->paneltab) return;
        if (panel->type && (panel->type->flag & PNL_NO_HEADER)) return;
 
@@ -523,14 +525,14 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
        headrect = *rect;
        headrect.ymin = headrect.ymax;
        headrect.ymax = headrect.ymin + floor(PNL_HEADER / block->aspect + 0.001f);
-       
+
        {
                float minx = rect->xmin;
                float maxx = rect->xmax;
                float y = headrect.ymax;
 
                glEnable(GL_BLEND);
-               
+
                if (UI_GetThemeValue(TH_PANEL_SHOW_HEADER)) {
                        /* draw with background color */
                        UI_ThemeColor4(TH_PANEL_HEADER);
@@ -543,7 +545,7 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
                        /* draw embossed separator */
                        minx += 5.0f / block->aspect;
                        maxx -= 5.0f / block->aspect;
-                       
+
                        glColor4f(0.0f, 0.0f, 0.0f, 0.5f);
                        fdrawline(minx, y, maxx, y);
                        glColor4f(1.0f, 1.0f, 1.0f, 0.25f);
@@ -552,11 +554,11 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
 
                glDisable(GL_BLEND);
        }
-       
+
        /* horizontal title */
        if (!(panel->flag & PNL_CLOSEDX)) {
                ui_draw_aligned_panel_header(style, block, &headrect, 'h');
-               
+
                /* itemrect smaller */
                itemrect.xmax = headrect.xmax - 5.0f / block->aspect;
                itemrect.xmin = itemrect.xmax - BLI_rcti_size_y(&headrect);
@@ -566,12 +568,11 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
                rectf_scale(&itemrect, 0.7f);
                ui_draw_panel_dragwidget(&itemrect);
        }
-       
+
        /* if the panel is minimized vertically:
         * (------)
         */
        if (panel->flag & PNL_CLOSEDY) {
-               
        }
        else if (panel->flag & PNL_CLOSEDX) {
                /* draw vertical title */
@@ -579,16 +580,15 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
        }
        /* an open panel */
        else {
-               
                /* in some occasions, draw a border */
                if (panel->flag & PNL_SELECT) {
                        if (panel->control & UI_PNL_SOLID) uiSetRoundBox(UI_CNR_ALL);
                        else uiSetRoundBox(UI_CNR_NONE);
-                       
+
                        UI_ThemeColorShade(TH_BACK, -120);
                        uiRoundRect(0.5f + rect->xmin, 0.5f + rect->ymin, 0.5f + rect->xmax, 0.5f + headrect.ymax + 1, 8);
                }
-               
+
                /* panel backdrop */
                if (UI_GetThemeValue(TH_PANEL_SHOW_BACK)) {
                        /* draw with background color */
@@ -596,32 +596,31 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
                        UI_ThemeColor4(TH_PANEL_BACK);
                        glRecti(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
                }
-               
+
                if (panel->control & UI_PNL_SCALE)
                        ui_draw_panel_scalewidget(rect);
        }
-       
+
        /* draw optional close icon */
-       
+
        ofsx = 6;
        if (panel->control & UI_PNL_CLOSE) {
-               
-               UI_ThemeColor(TH_TEXT);
+               UI_ThemeColor(TH_TITLE);
                ui_draw_x_icon(rect->xmin + 2 + ofsx, rect->ymax + 2);
                ofsx = 22;
        }
-       
+
        /* draw collapse icon */
-       UI_ThemeColor(TH_TEXT);
-       
+       UI_ThemeColor(TH_TITLE);
+
        /* itemrect smaller */
        itemrect.xmin = headrect.xmin + 5.0f / block->aspect;
        itemrect.xmax = itemrect.xmin + BLI_rcti_size_y(&headrect);
        itemrect.ymin = headrect.ymin;
        itemrect.ymax = headrect.ymax;
-       
+
        rectf_scale(&itemrect, 0.35f);
-       
+
        if (panel->flag & PNL_CLOSEDY)
                ui_draw_tria_rect(&itemrect, 'h');
        else if (panel->flag & PNL_CLOSEDX)
index daa92ef14fcbe687a9a20ed5ef049b8a8acf0a16..1c6263c9dd504864fbad3e40914e296e63f5c7fe 100644 (file)
@@ -336,7 +336,7 @@ void uiStyleInit(void)
        /* recover from uninitialized dpi */
        if (U.dpi == 0)
                U.dpi = 72;
-       CLAMP(U.dpi, 48, 128);
+       CLAMP(U.dpi, 48, 144);
        
        /* default builtin */
        if (font == NULL) {
index 464fcfb0496e73994319bac2a7b1bd5bacb20e7f..1a6d79c918dce5b8243e027b94ad87924a99b4b0 100644 (file)
@@ -1284,7 +1284,7 @@ static void do_preview_buttons(bContext *C, void *arg, int event)
 {
        switch (event) {
                case B_MATPRV:
-                       WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING, arg);
+                       WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_PREVIEW, arg);
                        break;
        }
 }
@@ -2640,6 +2640,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
                                        subblock = uiLayoutGetBlock(col);
                                        overlap = uiLayoutOverlap(col);
 
+                                       uiBlockSetFlag(subblock, UI_BLOCK_LIST_ITEM);
+
                                        /* list item behind label & other buttons */
                                        sub = uiLayoutRow(overlap, FALSE);
 
@@ -2653,6 +2655,11 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
                                        if (icon == ICON_DOT)
                                                icon = ICON_NONE;
                                        draw_item(ui_list, C, sub, dataptr, &itemptr, icon, active_dataptr, active_propname, i);
+
+                                       /* If we are "drawing" active item, set all labels as active. */
+                                       if (i == activei) {
+                                               ui_layout_list_set_labels_active(sub);
+                                       }
                                }
                                i++;
                        }
@@ -2721,6 +2728,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
                                subblock = uiLayoutGetBlock(row);
                                overlap = uiLayoutOverlap(row);
 
+                               uiBlockSetFlag(subblock, UI_BLOCK_LIST_ITEM);
+
                                /* list item behind label & other buttons */
                                sub = uiLayoutRow(overlap, FALSE);
 
@@ -2733,6 +2742,11 @@ void uiTemplateList(uiLayout *layout, bContext *C, const char *listtype_name, co
                                icon = UI_rnaptr_icon_get(C, &itemptr, rnaicon, false);
                                draw_item(ui_list, C, sub, dataptr, &itemptr, icon, active_dataptr, active_propname, i);
 
+                               /* If we are "drawing" active item, set all labels as active. */
+                               if (i == activei) {
+                                       ui_layout_list_set_labels_active(sub);
+                               }
+
                                i++;
                        }
                        RNA_PROP_END;
index d8efb972ce9a15161876d73dc6c103dc73b598e7..6ac681104d0fc555a4d2e9676211a3b33cf414a8 100644 (file)
@@ -883,7 +883,8 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, const rcti
        }
        
        /* extra feature allows more alpha blending */
-       if (but->type == LABEL && but->a1 == 1.0f) alpha *= but->a2;
+       if (ELEM(but->type, LABEL, LISTLABEL) && but->a1 == 1.0f)
+               alpha *= but->a2;
        
        glEnable(GL_BLEND);
        
@@ -1731,19 +1732,6 @@ static void widget_state_numslider(uiWidgetType *wt, int state)
        }
 }
 
-/* labels use theme colors for text */
-static void widget_state_label(uiWidgetType *wt, int state)
-{
-       /* call this for option button */
-       widget_state(wt, state);
-
-       if (state & UI_SELECT)
-               UI_GetThemeColor3ubv(TH_TEXT_HI, (unsigned char *)wt->wcol.text);
-       else
-               UI_GetThemeColor3ubv(TH_TEXT, (unsigned char *)wt->wcol.text);
-       
-}
-
 /* labels use theme colors for text */
 static void widget_state_option_menu(uiWidgetType *wt, int state)
 {
@@ -2980,9 +2968,11 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)
                case UI_WTYPE_REGULAR:
                        break;
 
+               case UI_WTYPE_LISTLABEL:
+                       wt.wcol_theme = &btheme->tui.wcol_list_item;
+                       /* No break, we use usual label code too. */
                case UI_WTYPE_LABEL:
                        wt.draw = NULL;
-                       wt.state = widget_state_label;
                        break;
                        
                case UI_WTYPE_TOGGLE:
@@ -3230,6 +3220,11 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
                                }
                                break;
                                
+                       case LISTLABEL:
+                               wt = widget_type(UI_WTYPE_LISTLABEL);
+                               fstyle = &style->widgetlabel;
+                               break;
+
                        case SEPR:
                                break;
                                
index e194f9907398efdb035ef57b11990e7e3516d720..82d958a5c7b5130d0afebd912b22bf1611db58eb 100644 (file)
@@ -74,6 +74,8 @@ void paintface_flush_flags(Object *ob)
        if (me == NULL)
                return;
 
+       /* note, call #BKE_mesh_flush_hidden_from_verts_ex first when changing hidden flags */
+
        /* we could call this directly in all areas that change selection,
         * since this could become slow for realtime updates (circle-select for eg) */
        BKE_mesh_flush_select_from_polys(me);
@@ -139,18 +141,20 @@ void paintface_hide(Object *ob, const bool unselected)
        a = me->totpoly;
        while (a--) {
                if ((mpoly->flag & ME_HIDE) == 0) {
-                       if (unselected) {
-                               if ((mpoly->flag & ME_FACE_SEL) == 0) mpoly->flag |= ME_HIDE;
-                       }
-                       else {
-                               if ((mpoly->flag & ME_FACE_SEL)) mpoly->flag |= ME_HIDE;
+                       if (((mpoly->flag & ME_FACE_SEL) == 0) == unselected) {
+                               mpoly->flag |= ME_HIDE;
                        }
                }
-               if (mpoly->flag & ME_HIDE) mpoly->flag &= ~ME_FACE_SEL;
+
+               if (mpoly->flag & ME_HIDE) {
+                       mpoly->flag &= ~ME_FACE_SEL;
+               }
                
                mpoly++;
        }
        
+       BKE_mesh_flush_hidden_from_polys(me);
+
        paintface_flush_flags(ob);
 }
 
@@ -174,6 +178,8 @@ void paintface_reveal(Object *ob)
                mpoly++;
        }
 
+       BKE_mesh_flush_hidden_from_polys(me);
+
        paintface_flush_flags(ob);
 }
 
index ed2744509a6b784ca5f9512dc033d911a7557cf0..e544592365de55adeb81e133cd7b673c511d97e3 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 #include "DNA_object_types.h"
+#include "DNA_scene_types.h"
 
 #include "BLI_math.h"
 
index ed55383e8a4429b65372a038e7cb787ca96f6bea..6033e7ee471ca74b03abf01681cb55c612aee1b6 100644 (file)
@@ -117,7 +117,7 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
 
                opdata->mesh_backup = EDBM_redo_state_store(em);
                opdata->draw_handle_pixel = ED_region_draw_cb_activate(ar->type, ED_region_draw_mouse_line_cb, opdata->mcenter, REGION_DRAW_POST_PIXEL);
-               G.moving = true;
+               G.moving = G_TRANSFORM_EDIT;
                opdata->twtype = v3d->twtype;
                v3d->twtype = 0;
        }
@@ -179,7 +179,7 @@ static void edbm_bevel_exit(bContext *C, wmOperator *op)
                EDBM_redo_state_free(&opdata->mesh_backup, NULL, false);
                ED_region_draw_cb_exit(ar->type, opdata->draw_handle_pixel);
                v3d->twtype = opdata->twtype;
-               G.moving = false;
+               G.moving = 0;
        }
        MEM_freeN(opdata);
        op->customdata = NULL;
index ef1767de3bd8d717556dc33f5e758774d4a6ad47..dba19ee5da66af508fb2259a916cc34a34ab914c 100644 (file)
@@ -136,7 +136,7 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
 
                opdata->mesh_backup = EDBM_redo_state_store(em);
                opdata->draw_handle_pixel = ED_region_draw_cb_activate(ar->type, ED_region_draw_mouse_line_cb, opdata->mcenter, REGION_DRAW_POST_PIXEL);
-               G.moving = true;
+               G.moving = G_TRANSFORM_EDIT;
                opdata->twtype = v3d->twtype;
                v3d->twtype = 0;
        }
@@ -157,7 +157,7 @@ static void edbm_inset_exit(bContext *C, wmOperator *op)
                EDBM_redo_state_free(&opdata->mesh_backup, NULL, false);
                ED_region_draw_cb_exit(ar->type, opdata->draw_handle_pixel);
                v3d->twtype = opdata->twtype;
-               G.moving = false;
+               G.moving = 0;
        }
 
        if (sa) {
index 7b6d198d5379b71d95e99cfd34b5a1ccb98dc403..e7eaa6258439bfd832e0cdd7d1e5b56e7127cee8 100644 (file)
@@ -83,28 +83,22 @@ static bool mouse_mesh_shortest_path_vert(ViewContext *vc)
        /* unlike edge/face versions, this uses a bmesh operator */
 
        BMEditMesh *em = vc->em;
+       BMesh *bm = em->bm;
        BMVert *v_dst;
        float dist = 75.0f;
        const bool use_length = true;
 
        v_dst = EDBM_vert_find_nearest(vc, &dist, false, false);
        if (v_dst) {
-               struct UserData user_data = {vc->em->bm, vc->obedit->data, vc->scene};
+               struct UserData user_data = {bm, vc->obedit->data, vc->scene};
                LinkNode *path = NULL;
+               BMVert *v_act = BM_mesh_active_vert_get(bm);
 
-               if (em->bm->selected.last) {
-                       BMEditSelection *ese = em->bm->selected.last;
-
-                       if (ese && ese->htype == BM_VERT) {
-                               BMVert *v_act;
-                               v_act = (BMVert *)ese->ele;
-                               if (v_act != v_dst) {
-                                       if ((path = BM_mesh_calc_path_vert(em->bm, v_act, v_dst, use_length,
-                                                                          &user_data, verttag_filter_cb)))
-                                       {
-                                               BM_select_history_remove(em->bm, v_act);
-                                       }
-                               }
+               if (v_act && (v_act != v_dst)) {
+                       if ((path = BM_mesh_calc_path_vert(bm, v_act, v_dst, use_length,
+                                                          &user_data, verttag_filter_cb)))
+                       {
+                               BM_select_history_remove(bm, v_act);
                        }
                }
 
@@ -137,9 +131,9 @@ static bool mouse_mesh_shortest_path_vert(ViewContext *vc)
 
                /* even if this is selected it may not be in the selection list */
                if (BM_elem_flag_test(v_dst, BM_ELEM_SELECT) == 0)
-                       BM_select_history_remove(em->bm, v_dst);
+                       BM_select_history_remove(bm, v_dst);
                else
-                       BM_select_history_store(em->bm, v_dst);
+                       BM_select_history_store(bm, v_dst);
 
                EDBM_update_generic(em, false, false);
 
@@ -170,7 +164,7 @@ static bool edgetag_test_cb(BMEdge *e, void *user_data_v)
                case EDGE_MODE_SELECT:
                        return BM_elem_flag_test(e, BM_ELEM_SELECT) ? true : false;
                case EDGE_MODE_TAG_SEAM:
-                       return BM_elem_flag_test(e, BM_ELEM_SEAM) ? false : true;
+                       return BM_elem_flag_test(e, BM_ELEM_SEAM) ? true : false;
                case EDGE_MODE_TAG_SHARP:
                        return BM_elem_flag_test(e, BM_ELEM_SMOOTH) ? false : true;
                case EDGE_MODE_TAG_CREASE:
@@ -254,31 +248,26 @@ static void edgetag_ensure_cd_flag(Scene *scene, Mesh *me)
 static bool mouse_mesh_shortest_path_edge(ViewContext *vc)
 {
        BMEditMesh *em = vc->em;
+       BMesh *bm = em->bm;
        BMEdge *e_dst;
        float dist = 75.0f;
        const bool use_length = true;
 
        e_dst = EDBM_edge_find_nearest(vc, &dist);
        if (e_dst) {
-               struct UserData user_data = {vc->em->bm, vc->obedit->data, vc->scene};
+               const char edge_mode = vc->scene->toolsettings->edge_mode;
+               struct UserData user_data = {bm, vc->obedit->data, vc->scene};
                LinkNode *path = NULL;
                Mesh *me = vc->obedit->data;
+               BMEdge *e_act = BM_mesh_active_edge_get(bm);
 
                edgetag_ensure_cd_flag(vc->scene, em->ob->data);
 
-               if (em->bm->selected.last) {
-                       BMEditSelection *ese = em->bm->selected.last;
-
-                       if (ese && ese->htype == BM_EDGE) {
-                               BMEdge *e_act;
-                               e_act = (BMEdge *)ese->ele;
-                               if (e_act != e_dst) {
-                                       if ((path = BM_mesh_calc_path_edge(em->bm, e_act, e_dst, use_length,
-                                                                          &user_data, edgetag_filter_cb)))
-                                       {
-                                               BM_select_history_remove(em->bm, e_act);
-                                       }
-                               }
+               if (e_act && (e_act != e_dst)) {
+                       if ((path = BM_mesh_calc_path_edge(bm, e_act, e_dst, use_length,
+                                                          &user_data, edgetag_filter_cb)))
+                       {
+                               BM_select_history_remove(bm, e_act);
                        }
                }
 
@@ -308,16 +297,26 @@ static bool mouse_mesh_shortest_path_edge(ViewContext *vc)
                        edgetag_set_cb(e_dst, is_act, &user_data); /* switch the edge option */
                }
 
+               if (edge_mode != EDGE_MODE_SELECT) {
+                       /* simple rules - last edge is _always_ active and selected */
+                       if (e_act)
+                               BM_edge_select_set(bm, e_act, false);
+                       BM_edge_select_set(bm, e_dst, true);
+                       BM_select_history_store(bm, e_dst);
+               }
+
                EDBM_selectmode_flush(em);
 
                /* even if this is selected it may not be in the selection list */
-               if (edgetag_test_cb(e_dst, &user_data) == 0)
-                       BM_select_history_remove(em->bm, e_dst);
-               else
-                       BM_select_history_store(em->bm, e_dst);
+               if (edge_mode == EDGE_MODE_SELECT) {
+                       if (edgetag_test_cb(e_dst, &user_data) == 0)
+                               BM_select_history_remove(bm, e_dst);
+                       else
+                               BM_select_history_store(bm, e_dst);
+               }
 
                /* force drawmode for mesh */
-               switch (vc->scene->toolsettings->edge_mode) {
+               switch (edge_mode) {
 
                        case EDGE_MODE_TAG_SEAM:
                                me->drawflag |= ME_DRAWSEAMS;
@@ -373,22 +372,23 @@ static void facetag_set_cb(BMFace *f, bool val, void *user_data_v)
 static bool mouse_mesh_shortest_path_face(ViewContext *vc)
 {
        BMEditMesh *em = vc->em;
+       BMesh *bm = em->bm;
        BMFace *f_dst;
        float dist = 75.0f;
        const bool use_length = true;
 
        f_dst = EDBM_face_find_nearest(vc, &dist);
        if (f_dst) {
-               struct UserData user_data = {vc->em->bm, vc->obedit->data, vc->scene};
+               struct UserData user_data = {bm, vc->obedit->data, vc->scene};
                LinkNode *path = NULL;
-               BMFace *f_act = BM_active_face_get(em->bm, false, true);
+               BMFace *f_act = BM_mesh_active_face_get(bm, false, true);
 
                if (f_act) {
                        if (f_act != f_dst) {
-                               if ((path = BM_mesh_calc_path_face(em->bm, f_act, f_dst, use_length,
+                               if ((path = BM_mesh_calc_path_face(bm, f_act, f_dst, use_length,
                                                                   &user_data, facetag_filter_cb)))
                                {
-                                       BM_select_history_remove(em->bm, f_act);
+                                       BM_select_history_remove(bm, f_act);
                                }
                        }
                }
@@ -422,11 +422,11 @@ static bool mouse_mesh_shortest_path_face(ViewContext *vc)
 
                /* even if this is selected it may not be in the selection list */
                if (facetag_test_cb(f_dst, &user_data) == 0)
-                       BM_select_history_remove(em->bm, f_dst);
+                       BM_select_history_remove(bm, f_dst);
                else
-                       BM_select_history_store(em->bm, f_dst);
+                       BM_select_history_store(bm, f_dst);
 
-               BM_active_face_set(em->bm, f_dst);
+               BM_mesh_active_face_set(bm, f_dst);
 
                EDBM_update_generic(em, false, false);
 
@@ -513,6 +513,7 @@ static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
 {
        Object *ob = CTX_data_edit_object(C);
        BMEditMesh *em = BKE_editmesh_from_object(ob);
+       BMesh *bm = em->bm;
        BMIter iter;
        BMEditSelection *ese_src, *ese_dst;
        BMElem *ele_src = NULL, *ele_dst = NULL, *ele;
@@ -520,7 +521,7 @@ static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
        const bool use_length = RNA_boolean_get(op->ptr, "use_length");
 
        /* first try to find vertices in edit selection */
-       ese_src = em->bm->selected.last;
+       ese_src = bm->selected.last;
        if (ese_src && (ese_dst = ese_src->prev) && (ese_src->htype  == ese_dst->htype)) {
                ele_src = ese_src->ele;
                ele_dst = ese_dst->ele;
@@ -528,8 +529,8 @@ static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
        else {
                /* if selection history isn't available, find two selected elements */
                ele_src = ele_dst = NULL;
-               if ((em->selectmode & SCE_SELECT_VERTEX) && (em->bm->totvertsel >= 2)) {
-                       BM_ITER_MESH (ele, &iter, em->bm, BM_VERTS_OF_MESH) {
+               if ((em->selectmode & SCE_SELECT_VERTEX) && (bm->totvertsel >= 2)) {
+                       BM_ITER_MESH (ele, &iter, bm, BM_VERTS_OF_MESH) {
                                if (BM_elem_flag_test(ele, BM_ELEM_SELECT)) {
                                        if      (ele_src == NULL) ele_src = ele;
                                        else if (ele_dst == NULL) ele_dst = ele;
@@ -538,9 +539,9 @@ static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
                        }
                }
 
-               if ((ele_dst == NULL) && (em->selectmode & SCE_SELECT_EDGE) && (em->bm->totedgesel >= 2)) {
+               if ((ele_dst == NULL) && (em->selectmode & SCE_SELECT_EDGE) && (bm->totedgesel >= 2)) {
                        ele_src = NULL;
-                       BM_ITER_MESH (ele, &iter, em->bm, BM_EDGES_OF_MESH) {
+                       BM_ITER_MESH (ele, &iter, bm, BM_EDGES_OF_MESH) {
                                if (BM_elem_flag_test(ele, BM_ELEM_SELECT)) {
                                        if      (ele_src == NULL) ele_src = ele;
                                        else if (ele_dst == NULL) ele_dst = ele;
@@ -549,9 +550,9 @@ static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
                        }
                }
 
-               if ((ele_dst == NULL) && (em->selectmode & SCE_SELECT_FACE) && (em->bm->totfacesel >= 2)) {
+               if ((ele_dst == NULL) && (em->selectmode & SCE_SELECT_FACE) && (bm->totfacesel >= 2)) {
                        ele_src = NULL;
-                       BM_ITER_MESH (ele, &iter, em->bm, BM_FACES_OF_MESH) {
+                       BM_ITER_MESH (ele, &iter, bm, BM_FACES_OF_MESH) {
                                if (BM_elem_flag_test(ele, BM_ELEM_SELECT)) {
                                        if      (ele_src == NULL) ele_src = ele;
                                        else if (ele_dst == NULL) ele_dst = ele;
@@ -566,17 +567,17 @@ static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
                switch (ele_src->head.htype) {
                        case BM_VERT:
                                path = BM_mesh_calc_path_vert(
-                                          em->bm, (BMVert *)ele_src, (BMVert *)ele_dst, use_length,
+                                          bm, (BMVert *)ele_src, (BMVert *)ele_dst, use_length,
                                           NULL, (bool (*)(BMVert *, void *))ele_filter_visible_cb);
                                break;
                        case BM_EDGE:
                                path = BM_mesh_calc_path_edge(
-                                          em->bm, (BMEdge *)ele_src, (BMEdge *)ele_dst, use_length,
+                                          bm, (BMEdge *)ele_src, (BMEdge *)ele_dst, use_length,
                                           NULL, (bool (*)(BMEdge *, void *))ele_filter_visible_cb);
                                break;
                        case BM_FACE:
                                path = BM_mesh_calc_path_face(
-                                          em->bm, (BMFace *)ele_src, (BMFace *)ele_dst, use_length,
+                                          bm, (BMFace *)ele_src, (BMFace *)ele_dst, use_length,
                                           NULL, (bool (*)(BMFace *, void *))ele_filter_visible_cb);
                                break;
                }
@@ -585,7 +586,7 @@ static int edbm_shortest_path_select_exec(bContext *C, wmOperator *op)
                        LinkNode *node = path;
 
                        do {
-                               BM_elem_select_set(em->bm, node->link, true);
+                               BM_elem_select_set(bm, node->link, true);
                        } while ((node = node->next));
 
                        BLI_linklist_free(path, NULL);
index 77b913655356b64c3a7776a334a3c02dc0a51742..df5d764d69b139bd5a62eaee6c70fca0ab9b4435 100644 (file)
@@ -1204,7 +1204,7 @@ static void mouse_mesh_loop(bContext *C, const int mval[2], bool extend, bool de
                                        }
                                }
                                if (efa) {
-                                       BM_active_face_set(em->bm, efa);
+                                       BM_mesh_active_face_set(em->bm, efa);
                                        BM_select_history_store(em->bm, efa);
                                }
                        }
@@ -1371,7 +1371,7 @@ bool EDBM_select_pick(bContext *C, const int mval[2], bool extend, bool deselect
                if (efa) {
                        if (extend) {
                                /* set the last selected face */
-                               BM_active_face_set(vc.em->bm, efa);
+                               BM_mesh_active_face_set(vc.em->bm, efa);
 
                                /* Work-around: deselect first, so we can guarantee it will */
                                /* be active even if it was already selected */
@@ -1386,7 +1386,7 @@ bool EDBM_select_pick(bContext *C, const int mval[2], bool extend, bool deselect
                        }
                        else {
                                /* set the last selected face */
-                               BM_active_face_set(vc.em->bm, efa);
+                               BM_mesh_active_face_set(vc.em->bm, efa);
 
                                if (!BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
                                        BM_select_history_store(vc.em->bm, efa);
@@ -2383,27 +2383,25 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed,
        BMEdge *e;
        BMFace *f;
        BMIter iter;
-       BMEditSelection *ese;
+       BMElem *ele;
 
        *r_eve = NULL;
        *r_eed = NULL;
        *r_efa = NULL;
 
        EDBM_selectmode_flush(em);
-       ese = (BMEditSelection *)em->bm->selected.last;
+       ele = BM_mesh_active_elem_get(em->bm);
 
-       if (ese) {
-               switch (ese->htype) {
-                       case BM_VERT:
-                               *r_eve = (BMVert *)ese->ele;
-                               return;
-                       case BM_EDGE:
-                               *r_eed = (BMEdge *)ese->ele;
-                               return;
-                       case BM_FACE:
-                               *r_efa = (BMFace *)ese->ele;
-                               return;
-               }
+       switch (ele->head.htype) {
+               case BM_VERT:
+                       *r_eve = (BMVert *)ele;
+                       return;
+               case BM_EDGE:
+                       *r_eed = (BMEdge *)ele;
+                       return;
+               case BM_FACE:
+                       *r_efa = (BMFace *)ele;
+                       return;
        }
 
        if (em->selectmode & SCE_SELECT_VERTEX) {
@@ -2423,7 +2421,7 @@ static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed,
                }
        }
        else if (em->selectmode & SCE_SELECT_FACE) {
-               f = BM_active_face_get(em->bm, true, false);
+               f = BM_mesh_active_face_get(em->bm, true, false);
                if (f) {
                        *r_efa = f;
                        return;
@@ -2832,39 +2830,40 @@ static int edbm_select_axis_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
-       BMEditSelection *ese = em->bm->selected.last;
+       BMesh *bm = em->bm;
+       BMVert *v_act = BM_mesh_active_vert_get(bm);
        const int axis = RNA_enum_get(op->ptr, "axis");
        const int mode = RNA_enum_get(op->ptr, "mode"); /* -1 == aligned, 0 == neg, 1 == pos */
 
-       if (ese == NULL || ese->htype != BM_VERT) {
+       if (v_act == NULL) {
                BKE_report(op->reports, RPT_WARNING, "This operator requires an active vertex (last selected)");
                return OPERATOR_CANCELLED;
        }
        else {
-               BMVert *ev, *act_vert = (BMVert *)ese->ele;
+               BMVert *v;
                BMIter iter;
-               float value = act_vert->co[axis];
-               float limit =  CTX_data_tool_settings(C)->doublimit; // XXX
+               const float limit =  CTX_data_tool_settings(C)->doublimit; // XXX
+               float value = v_act->co[axis];
 
                if (mode == 0)
                        value -= limit;
                else if (mode == 1)
                        value += limit;
 
-               BM_ITER_MESH (ev, &iter, em->bm, BM_VERTS_OF_MESH) {
-                       if (!BM_elem_flag_test(ev, BM_ELEM_HIDDEN)) {
+               BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
+                       if (!BM_elem_flag_test(v, BM_ELEM_HIDDEN)) {
                                switch (mode) {
                                        case -1: /* aligned */
-                                               if (fabsf(ev->co[axis] - value) < limit)
-                                                       BM_vert_select_set(em->bm, ev, true);
+                                               if (fabsf(v->co[axis] - value) < limit)
+                                                       BM_vert_select_set(bm, v, true);
                                                break;
                                        case 0: /* neg */
-                                               if (ev->co[axis] > value)
-                                                       BM_vert_select_set(em->bm, ev, true);
+                                               if (v->co[axis] > value)
+                                                       BM_vert_select_set(bm, v, true);
                                                break;
                                        case 1: /* pos */
-                                               if (ev->co[axis] < value)
-                                                       BM_vert_select_set(em->bm, ev, true);
+                                               if (v->co[axis] < value)
+                                                       BM_vert_select_set(bm, v, true);
                                                break;
                                }
                        }
index 508936190c8c63f88411e0f5f55202c9f5d181b7..51d02e8cc2b83c317fe2aa8b42ad4148f5ae0933 100644 (file)
@@ -37,6 +37,7 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_object_types.h"
+#include "DNA_scene_types.h"
 
 #include "BLI_listbase.h"
 #include "BLI_noise.h"
index f3540fe62b72614e76b6272579deb2b05a6ef084..560c314405e4a55d2d9b2fce7b79d1c89588195f 100644 (file)
@@ -1089,7 +1089,7 @@ MTexPoly *EDBM_mtexpoly_active_get(BMEditMesh *em, BMFace **r_act_efa, const boo
        if (!EDBM_mtexpoly_check(em))
                return NULL;
        
-       efa = BM_active_face_get(em->bm, sloppy, selected);
+       efa = BM_mesh_active_face_get(em->bm, sloppy, selected);
 
        if (efa) {
                if (r_act_efa) *r_act_efa = efa;
index 7a1fdd71b20f07cae39aef01bf74b52fa6b81518..ba9bd8d3f7b5f7b15bc1049d8f37a1a161d4177d 100644 (file)
@@ -501,7 +501,7 @@ static int navmesh_face_copy_exec(bContext *C, wmOperator *op)
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
 
        /* do work here */
-       BMFace *efa_act = BM_active_face_get(em->bm, false, false);
+       BMFace *efa_act = BM_mesh_active_face_get(em->bm, false, false);
 
        if (efa_act) {
                if (CustomData_has_layer(&em->bm->pdata, CD_RECAST)) {
index 7fe0c3b0344a328419f17f625d9ebff650ac76ea..c97b674dd2d81e4ac905447ac6c57dadb6ac2547 100644 (file)
@@ -28,6 +28,8 @@
  *  \ingroup edmesh
  */
 
+#include "DNA_scene_types.h"
+
 #include "BLI_math.h"
 
 #include "RNA_access.h"
index e34b792ab69916a98921893168ec2e01089f0025..b0d337c365f008405f0a12de26115b86ceed03e3 100644 (file)
@@ -1362,3 +1362,53 @@ bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int
 
        return true;
 }
+
+
+MDeformVert *ED_mesh_active_dvert_get_em(Object *ob, BMVert **r_eve)
+{
+       if (ob->mode & OB_MODE_EDIT && ob->type == OB_MESH && ob->defbase.first) {
+               Mesh *me = ob->data;
+               BMesh *bm = me->edit_btmesh->bm;
+               const int cd_dvert_offset = CustomData_get_offset(&bm->vdata, CD_MDEFORMVERT);
+
+               if (cd_dvert_offset != -1) {
+                       BMVert *eve = BM_mesh_active_vert_get(bm);
+
+                       if (eve) {
+                               if (r_eve) *r_eve = eve;
+                               return BM_ELEM_CD_GET_VOID_P(eve, cd_dvert_offset);
+                       }
+               }
+       }
+
+       if (r_eve) *r_eve = NULL;
+       return NULL;
+}
+
+MDeformVert *ED_mesh_active_dvert_get_ob(Object *ob, int *r_index)
+{
+       Mesh *me = ob->data;
+       int index = BKE_mesh_mselect_active_get(me, ME_VSEL);
+       if (r_index) *r_index = index;
+       if (index == -1 || me->dvert == NULL) {
+               return NULL;
+       }
+       else {
+               return me->dvert + index;
+       }
+}
+
+MDeformVert *ED_mesh_active_dvert_get_only(Object *ob)
+{
+       if (ob->type == OB_MESH) {
+               if (ob->mode & OB_MODE_EDIT) {
+                       return ED_mesh_active_dvert_get_em(ob, NULL);
+               }
+               else {
+                       return ED_mesh_active_dvert_get_ob(ob, NULL);
+               }
+       }
+       else {
+               return NULL;
+       }
+}
index 8c705aac0d2b6a356f5081fbc60a667c37529440..bba0dc5000bec8fc62c88485bc6010657c6cb0fc 100644 (file)
@@ -28,6 +28,8 @@
  *  \ingroup edmeta
  */
 
+#include "DNA_scene_types.h"
+
 #include "BLI_utildefines.h"
 
 #include "RNA_access.h"
index 5ad6bd4993af7fbe81be35c7045367312870960a..c7aec9f93d49b6c9856e92adc8399a23f420340c 100644 (file)
@@ -1762,7 +1762,7 @@ void OBJECT_OT_convert(wmOperatorType *ot)
 
 /* 
  * dupflag: a flag made from constants declared in DNA_userdef_types.h
- * The flag tells adduplicate() weather to copy data linked to the object, or to reference the existing data.
+ * The flag tells adduplicate() whether to copy data linked to the object, or to reference the existing data.
  * U.dupflag for default operations or you can construct a flag as python does
  * if the dupflag is 0 then no data will be copied (linked duplicate) */
 
index 485987fd8fe122f1df571dadb3f49ba3aa6bb7f4..b3ce932085237128e0a4c4e77b0570f9e608809d 100644 (file)
@@ -226,7 +226,7 @@ void OBJECT_OT_vertex_group_move(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_weight_paste(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_weight_delete(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_weight_set_active(struct wmOperatorType *ot);
-void OBJECT_OT_vertex_weight_normalize_active(struct wmOperatorType *ot);
+void OBJECT_OT_vertex_weight_normalize_active_vertex(struct wmOperatorType *ot);
 void OBJECT_OT_vertex_weight_copy(struct wmOperatorType *ot);
 
 /* object_shapekey.c */
index 3afb04c34f6402acba96794ea7340f6eef239546..356bda109a4a8278a77b32f0cf23995043f7b7f9 100644 (file)
@@ -198,7 +198,7 @@ void ED_operatortypes_object(void)
        WM_operatortype_append(OBJECT_OT_vertex_weight_paste);
        WM_operatortype_append(OBJECT_OT_vertex_weight_delete);
        WM_operatortype_append(OBJECT_OT_vertex_weight_set_active);
-       WM_operatortype_append(OBJECT_OT_vertex_weight_normalize_active);
+       WM_operatortype_append(OBJECT_OT_vertex_weight_normalize_active_vertex);
        WM_operatortype_append(OBJECT_OT_vertex_weight_copy);
 
        WM_operatortype_append(OBJECT_OT_game_property_new);
index f9704343fdd7cef89da3baac33b0a82e389d45f4..8fead6024fbb5895741a7d06aae7ca38887610e3 100644 (file)
@@ -57,6 +57,7 @@
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_object.h"
+#include "BKE_lattice.h"
 #include "BKE_curve.h"
 
 #include "BLI_sys_types.h" // for intptr_t support
@@ -244,14 +245,14 @@ static bool object_shape_key_mirror(bContext *C, Object *ob,
                                                int u_inv = (lt->pntsu - 1) - u;
                                                float tvec[3];
                                                if (u == u_inv) {
-                                                       i1 = LT_INDEX(lt, u, v, w);
+                                                       i1 = BKE_lattice_index_from_uvw(lt, u, v, w);
                                                        fp1 = ((float *)kb->data) + i1 * 3;
                                                        fp1[0] = -fp1[0];
                                                        totmirr++;
                                                }
                                                else {
-                                                       i1 = LT_INDEX(lt, u, v, w);
-                                                       i2 = LT_INDEX(lt, u_inv, v, w);
+                                                       i1 = BKE_lattice_index_from_uvw(lt, u, v, w);
+                                                       i2 = BKE_lattice_index_from_uvw(lt, u_inv, v, w);
 
                                                        fp1 = ((float *)kb->data) + i1 * 3;
                                                        fp2 = ((float *)kb->data) + i2 * 3;
index 6da403074e81f99cc7aaa4a63520906002a03e71..7144ef07e7435533d754596a77ec6b69de5ad67f 100644 (file)
@@ -411,28 +411,6 @@ bool ED_vgroup_copy_array(Object *ob, Object *ob_from)
        return true;
 }
 
-static MDeformVert *ED_mesh_active_dvert_get_em(Object *ob, BMVert **r_eve)
-{
-       if (ob->mode & OB_MODE_EDIT && ob->type == OB_MESH && ob->defbase.first) {
-               Mesh *me = ob->data;
-               BMEditMesh *em = me->edit_btmesh;
-               const int cd_dvert_offset = CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT);
-
-               if (cd_dvert_offset != -1) {
-                       BMEditSelection *ese = (BMEditSelection *)em->bm->selected.last;
-
-                       if (ese && ese->htype == BM_VERT) {
-                               BMVert *eve = (BMVert *)ese->ele;
-                               if (r_eve) *r_eve = eve;
-                               return BM_ELEM_CD_GET_VOID_P(eve, cd_dvert_offset);
-                       }
-               }
-       }
-
-       if (r_eve) *r_eve = NULL;
-       return NULL;
-}
-
 /* TODO, cache flip data to speedup calls within a loop. */
 static void mesh_defvert_mirror_update_internal(Object *ob,
                                                 MDeformVert *dvert_dst, MDeformVert *dvert_src,
@@ -454,19 +432,6 @@ static void mesh_defvert_mirror_update_internal(Object *ob,
        }
 }
 
-static MDeformVert *ED_mesh_active_dvert_get_ob(Object *ob, int *r_index)
-{
-       Mesh *me = ob->data;
-       int index = BKE_mesh_mselect_active_get(me, ME_VSEL);
-       if (r_index) *r_index = index;
-       if (index == -1 || me->dvert == NULL) {
-               return NULL;
-       }
-       else {
-               return me->dvert + index;
-       }
-}
-
 static void ED_mesh_defvert_mirror_update_em(Object *ob, BMVert *eve, int def_nr, int vidx,
                                              const int cd_dvert_offset)
 {
@@ -499,21 +464,6 @@ static void ED_mesh_defvert_mirror_update_ob(Object *ob, int def_nr, int vidx)
        }
 }
 
-static MDeformVert *ED_mesh_active_dvert_get_only(Object *ob)
-{
-       if (ob->type == OB_MESH) {
-               if (ob->mode & OB_MODE_EDIT) {
-                       return ED_mesh_active_dvert_get_em(ob, NULL);
-               }
-               else {
-                       return ED_mesh_active_dvert_get_ob(ob, NULL);
-               }
-       }
-       else {
-               return NULL;
-       }
-}
-
 /**
  * Use when adjusting the active vertex weight and apply to mirror vertices.
  */
@@ -2527,8 +2477,8 @@ void ED_vgroup_mirror(Object *ob,
                                        if (u != u_inv) {
                                                BPoint *bp, *bp_mirr;
 
-                                               i1 = LT_INDEX(lt, u, v, w);
-                                               i2 = LT_INDEX(lt, u_inv, v, w);
+                                               i1 = BKE_lattice_index_from_uvw(lt, u, v, w);
+                                               i2 = BKE_lattice_index_from_uvw(lt, u_inv, v, w);
 
                                                bp = &lt->def[i1];
                                                bp_mirr = &lt->def[i2];
@@ -4171,8 +4121,8 @@ void OBJECT_OT_vertex_weight_paste(wmOperatorType *ot)
        ot->idname = "OBJECT_OT_vertex_weight_paste";
        ot->description = "Copy this group's weight to other selected verts";
 
-       prop = RNA_def_int(ot->srna, "weight_group",
-                       -1, 0, 0, "Weight Index", "Index of source weight in active Weight Group", 0, 0);
+       prop = RNA_def_int(ot->srna, "weight_group", -1, -1, INT_MAX, "Weight Index",
+                          "Index of source weight in active Weight Group", -1, INT_MAX);
        RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
 
        /* api callbacks */
@@ -4203,8 +4153,8 @@ void OBJECT_OT_vertex_weight_delete(wmOperatorType *ot)
        ot->idname = "OBJECT_OT_vertex_weight_delete";
        ot->description = "Delete this weight from the vertex";
 
-       prop = RNA_def_int(ot->srna, "weight_group",
-                       -1, 0, 0, "Weight Index", "Index of source weight in active Weight Group", 0, 0);
+       prop = RNA_def_int(ot->srna, "weight_group", -1, -1, INT_MAX, "Weight Index",
+                          "Index of source weight in active Weight Group", -1, INT_MAX);
        RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
 
        /* api callbacks */
@@ -4237,8 +4187,8 @@ void OBJECT_OT_vertex_weight_set_active(wmOperatorType *ot)
        ot->idname = "OBJECT_OT_vertex_weight_set_active";
        ot->description = "Set as active Vertex Group";
 
-       prop = RNA_def_int(ot->srna, "weight_group",
-                       -1, 0, 0, "Weight Index", "Index of source weight in active Weight Group", 0, 0);
+       prop = RNA_def_int(ot->srna, "weight_group", -1, -1, INT_MAX, "Weight Index",
+                          "Index of source weight in active Weight Group", -1, INT_MAX);
        RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
 
        /* api callbacks */
@@ -4249,7 +4199,7 @@ void OBJECT_OT_vertex_weight_set_active(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
-static int vertex_weight_normalize_active(bContext *C, wmOperator *UNUSED(op))
+static int vertex_weight_normalize_active_vertex(bContext *C, wmOperator *UNUSED(op))
 {
        Object *ob = ED_object_context(C);
        ToolSettings *ts = CTX_data_tool_settings(C);
@@ -4263,16 +4213,16 @@ static int vertex_weight_normalize_active(bContext *C, wmOperator *UNUSED(op))
        return OPERATOR_FINISHED;
 }
 
-void OBJECT_OT_vertex_weight_normalize_active(wmOperatorType *ot)
+void OBJECT_OT_vertex_weight_normalize_active_vertex(wmOperatorType *ot)
 {
 
        ot->name = "Normalize Active";
-       ot->idname = "OBJECT_OT_vertex_weight_normalize_active";
+       ot->idname = "OBJECT_OT_vertex_weight_normalize_active_vertex";
        ot->description = "Normalize Active Vert Weights";
 
        /* api callbacks */
        ot->poll = vertex_group_poll;
-       ot->exec = vertex_weight_normalize_active;
+       ot->exec = vertex_weight_normalize_active_vertex;
 
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
index 2ede7047b74836e2c9fd7a5256039bc7800e6f77..444c87ded34bcf7576e309152428a9d076e4ea78 100644 (file)
@@ -29,6 +29,8 @@
 
 #include <stdlib.h>
 
+#include "DNA_scene_types.h"
+
 #include "BLI_utildefines.h"
 
 #include "RNA_access.h"
index 4e94e534c4d4d212d4948d6b204ae7714028a22b..09138a5523aeeaf0a767d02bbfb2f88dca80b231 100644 (file)
@@ -38,6 +38,8 @@
 #include "BLI_threads.h"
 #include "BLI_utildefines.h"
 
+#include "PIL_time.h"
+
 #include "BLF_translation.h"
 
 #include "DNA_object_types.h"
@@ -296,13 +298,39 @@ static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str)
        mmap_used_memory = (mmap_in_use) / (1024.0 * 1024.0);
        megs_peak_memory = (peak_memory) / (1024.0 * 1024.0);
 
-       spos += sprintf(spos, "%s | ", (scene->lay & 0xFF000000) ? IFACE_("Localview") : IFACE_("Single Layer"));
+       /* local view */
+       if (rs->localview)
+               spos += sprintf(spos, "%s | ", IFACE_("Local View"));
+
+       /* frame number */
        spos += sprintf(spos, IFACE_("Frame:%d "), (scene->r.cfra));
 
+       /* previous and elapsed time */
+       BLI_timestr(rs->lastframetime, info_time_str, sizeof(info_time_str));
+
+       if (rs->infostr && rs->infostr[0]) {
+               if (rs->lastframetime != 0.0)
+                       spos += sprintf(spos, IFACE_("| Last:%s "), info_time_str);
+               else
+                       spos += sprintf(spos, "| ");
+
+               BLI_timestr(PIL_check_seconds_timer() - rs->starttime, info_time_str, sizeof(info_time_str));
+       }
+       else
+               spos += sprintf(spos, "| ");
+
+       spos += sprintf(spos, IFACE_("Time:%s "), info_time_str);
+
+       /* statistics */
        if (rs->statstr) {
-               spos += sprintf(spos, "| %s ", rs->statstr);
+               if (rs->statstr[0]) {
+                       spos += sprintf(spos, "| %s ", rs->statstr);
+               }
        }
        else {
+               if (rs->totvert || rs->totface || rs->tothalo || rs->totstrand || rs->totlamp)
+                       spos += sprintf(spos, "| ");
+
                if (rs->totvert) spos += sprintf(spos, IFACE_("Ve:%d "), rs->totvert);
                if (rs->totface) spos += sprintf(spos, IFACE_("Fa:%d "), rs->totface);
                if (rs->tothalo) spos += sprintf(spos, IFACE_("Ha:%d "), rs->tothalo);
@@ -310,10 +338,10 @@ static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str)
                if (rs->totlamp) spos += sprintf(spos, IFACE_("La:%d "), rs->totlamp);
 
                if (rs->mem_peak == 0.0f)
-                       spos += sprintf(spos, IFACE_("Mem:%.2fM (%.2fM, Peak %.2fM) "),
+                       spos += sprintf(spos, IFACE_("Mem:%.2fM (%.2fM, Peak %.2fM) "),
                                        megs_used_memory, mmap_used_memory, megs_peak_memory);
                else
-                       spos += sprintf(spos, IFACE_("Mem:%.2fM, Peak: %.2fM "), rs->mem_used, rs->mem_peak);
+                       spos += sprintf(spos, IFACE_("Mem:%.2fM, Peak: %.2fM "), rs->mem_used, rs->mem_peak);
 
                if (rs->curfield)
                        spos += sprintf(spos, IFACE_("Field %d "), rs->curfield);
@@ -321,12 +349,11 @@ static void make_renderinfo_string(RenderStats *rs, Scene *scene, char *str)
                        spos += sprintf(spos, IFACE_("Blur %d "), rs->curblur);
        }
 
-       BLI_timestr(rs->lastframetime, info_time_str, sizeof(info_time_str));
-       spos += sprintf(spos, IFACE_("Time:%s "), info_time_str);
-
+       /* full sample */
        if (rs->curfsa)
                spos += sprintf(spos, IFACE_("| Full Sample %d "), rs->curfsa);
        
+       /* extra info */
        if (rs->infostr && rs->infostr[0])
                spos += sprintf(spos, "| %s ", rs->infostr);
 
@@ -442,7 +469,7 @@ static void render_endjob(void *rjv)
 
        /* XXX render stability hack */
        G.is_rendering = FALSE;
-       WM_main_add_notifier(NC_SCENE|ND_RENDER_RESULT, NULL);
+       WM_main_add_notifier(NC_SCENE | ND_RENDER_RESULT, NULL);
 
        /* Partial render result will always update display buffer
         * for first render layer only. This is nice because you'll
index b3216849dbaea4298d828d506a4df2210139dd74..13379425258dd06126957ec5c27cd90a4e4ed27f 100644 (file)
@@ -269,10 +269,17 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
         */
 
        if (rect) {
+               int profile_to;
+               
+               if (BKE_scene_check_color_management_enabled(scene))
+                       profile_to = IB_PROFILE_LINEAR_RGB;
+               else
+                       profile_to = IB_PROFILE_SRGB;
+
                /* sequencer has got trickier conversion happened above
                 * also assume opengl's space matches byte buffer color space */
                IMB_buffer_float_from_byte(rr->rectf, rect,
-                                          IB_PROFILE_LINEAR_RGB, IB_PROFILE_SRGB, true,
+                                          profile_to, IB_PROFILE_SRGB, true,
                                           oglrender->sizex, oglrender->sizey, oglrender->sizex, oglrender->sizex);
        }
 
index 429156ea6a7782e608a96f18b4545ace2f2152aa..4ddacc3254ef2eb9ae139a31a714fc958080c300 100644 (file)
@@ -116,7 +116,7 @@ void ED_region_pixelspace(ARegion *ar)
 }
 
 /* only exported for WM */
-void ED_region_do_listen(ARegion *ar, wmNotifier *note)
+void ED_region_do_listen(bScreen *sc, ScrArea *sa, ARegion *ar, wmNotifier *note)
 {
        /* generic notes first */
        switch (note->category) {
@@ -130,15 +130,15 @@ void ED_region_do_listen(ARegion *ar, wmNotifier *note)
        }
 
        if (ar->type && ar->type->listener)
-               ar->type->listener(ar, note);
+               ar->type->listener(sc, sa, ar, note);
 }
 
 /* only exported for WM */
-void ED_area_do_listen(ScrArea *sa, wmNotifier *note)
+void ED_area_do_listen(bScreen *sc, ScrArea *sa, wmNotifier *note)
 {
        /* no generic notes? */
        if (sa->type && sa->type->listener) {
-               sa->type->listener(sa, note);
+               sa->type->listener(sc, sa, note);
        }
 }
 
index e0d578ec21073f7a505bb3c3e975cdd4a85c3b59..3db0bd61f03dd829a565a4180533cd00ad68308a 100644 (file)
@@ -416,9 +416,7 @@ static int hide_show_exec(bContext *C, wmOperator *op)
        /* ensure that edges and faces get hidden as well (not used by
         * sculpt but it looks wrong when entering editmode otherwise) */
        if (pbvh_type == PBVH_FACES) {
-               BKE_mesh_flush_hidden_from_verts(me->mvert, me->mloop,
-                                                me->medge, me->totedge,
-                                                me->mpoly, me->totpoly);
+               BKE_mesh_flush_hidden_from_verts(me);
        }
 
        ED_region_tag_redraw(ar);
index 7f47657c3ff8e4d39b13794dc5fae81f70285ff1..a24ee13e3bf6430dbce592b7c4673194a010000d 100644 (file)
@@ -2827,20 +2827,19 @@ static void project_paint_begin(ProjPaintState *ps)
         * this avoids re-generating the derived mesh just to get the new index */
        if (ps->do_layer_clone) {
                //int layer_num = CustomData_get_clone_layer(&ps->dm->faceData, CD_MTFACE);
-               int layer_num = CustomData_get_clone_layer(&((Mesh *)ps->ob->data)->fdata, CD_MTFACE);
+               int layer_num = CustomData_get_clone_layer(&((Mesh *)ps->ob->data)->pdata, CD_MTEXPOLY);
                if (layer_num != -1)
                        ps->dm_mtface_clone = CustomData_get_layer_n(&ps->dm->faceData, CD_MTFACE, layer_num);
 
                if (ps->dm_mtface_clone == NULL || ps->dm_mtface_clone == ps->dm_mtface) {
                        ps->do_layer_clone = FALSE;
                        ps->dm_mtface_clone = NULL;
-                       printf("ACK!\n");
                }
        }
 
        if (ps->do_layer_stencil) {
                //int layer_num = CustomData_get_stencil_layer(&ps->dm->faceData, CD_MTFACE);
-               int layer_num = CustomData_get_stencil_layer(&((Mesh *)ps->ob->data)->fdata, CD_MTFACE);
+               int layer_num = CustomData_get_stencil_layer(&((Mesh *)ps->ob->data)->pdata, CD_MTEXPOLY);
                if (layer_num != -1)
                        ps->dm_mtface_stencil = CustomData_get_layer_n(&ps->dm->faceData, CD_MTFACE, layer_num);
 
index df1978c49f65f776ef728e8cebd5fda17bc52c84..2c7824d4a0dcbf90e310568d3627820e1a6cb073 100644 (file)
@@ -1242,7 +1242,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        /*Weight paint's Vertex Selection Mode */
        keymap = WM_keymap_find(keyconf, "Weight Paint Vertex Selection", 0, 0);
        keymap->poll = vert_paint_poll;
-       WM_keymap_add_item(keymap, "PAINT_OT_vert_select_all", AKEY, KM_PRESS, 0, 0);
+       kmi = WM_keymap_add_item(keymap, "PAINT_OT_vert_select_all", AKEY, KM_PRESS, 0, 0);
+       RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
        kmi = WM_keymap_add_item(keymap, "PAINT_OT_vert_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
        RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
        WM_keymap_add_item(keymap, "VIEW3D_OT_select_border", BKEY, KM_PRESS, 0, 0);
@@ -1283,7 +1284,8 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        keymap = WM_keymap_find(keyconf, "Face Mask", 0, 0);
        keymap->poll = facemask_paint_poll;
 
-       WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", AKEY, KM_PRESS, 0, 0);
+       kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", AKEY, KM_PRESS, 0, 0);
+       RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
        kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
        RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
        kmi = WM_keymap_add_item(keymap, "PAINT_OT_face_select_hide", HKEY, KM_PRESS, 0, 0);
index b2bb455a0ba88e268fd1a5248490ffb6253e9497..7b0ff5a656f50b7a41f595f84740351d2ffbd9b2 100644 (file)
@@ -269,7 +269,7 @@ static void action_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
-static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
+static void action_channel_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -307,7 +307,7 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
        }
 }
 
-static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void action_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -355,7 +355,7 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
 }
 
 /* editor level listener */
-static void action_listener(ScrArea *sa, wmNotifier *wmn)
+static void action_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
        SpaceAction *saction = (SpaceAction *)sa->spacedata.first;
        
@@ -448,7 +448,7 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn)
        }
 }
 
-static void action_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void action_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index 2739d41a73d778319414806395f1a8f22c9e39db..bb0521d6589077b8bc2c6b38b3036d9262823948 100644 (file)
@@ -33,6 +33,7 @@
 #include "BLI_utildefines.h"
 
 #include "DNA_object_types.h"
+#include "DNA_scene_types.h"
 #include "DNA_windowmanager_types.h"
 
 
index e6c6df416bf65dcb9aa2f8d7f239e2083e170850..b01f653837cffd839fd47443f08313332fd73785 100644 (file)
@@ -225,7 +225,7 @@ static void buttons_area_redraw(ScrArea *sa, short buttons)
 }
 
 /* reused! */
-static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
+static void buttons_area_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
        SpaceButs *sbuts = sa->spacedata.first;
 
@@ -295,6 +295,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
                                case ND_SHADING:
                                case ND_SHADING_DRAW:
                                case ND_SHADING_LINKS:
+                               case ND_SHADING_PREVIEW:
                                        /* currently works by redraws... if preview is set, it (re)starts job */
                                        sbuts->preview = 1;
                                        break;
@@ -318,6 +319,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
                                case ND_SHADING:
                                case ND_SHADING_DRAW:
                                case ND_SHADING_LINKS:
+                               case ND_SHADING_PREVIEW:
                                case ND_NODES:
                                        /* currently works by redraws... if preview is set, it (re)starts job */
                                        sbuts->preview = 1;
index 986b71abc8a582fe7125dbf019499be7761f4474..36cf9fc44c6969473446706b54956a101ecdc170 100644 (file)
@@ -340,7 +340,7 @@ static SpaceLink *clip_duplicate(SpaceLink *sl)
        return (SpaceLink *)scn;
 }
 
-static void clip_listener(ScrArea *sa, wmNotifier *wmn)
+static void clip_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -1174,7 +1174,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar)
        }
 }
 
-static void clip_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void clip_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -1283,7 +1283,7 @@ static void clip_preview_area_draw(const bContext *C, ARegion *ar)
                dopesheet_area_draw(C, ar);
 }
 
-static void clip_preview_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
+static void clip_preview_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
 {
 }
 
@@ -1324,7 +1324,7 @@ static void clip_channels_area_draw(const bContext *C, ARegion *ar)
        UI_view2d_view_restore(C);
 }
 
-static void clip_channels_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
+static void clip_channels_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
 {
 }
 
@@ -1341,7 +1341,7 @@ static void clip_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
-static void clip_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void clip_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -1381,7 +1381,7 @@ static void clip_tools_area_draw(const bContext *C, ARegion *ar)
 
 /****************** tool properties region ******************/
 
-static void clip_props_area_listener(ARegion *ar, wmNotifier *wmn)
+static void clip_props_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -1426,7 +1426,7 @@ static void clip_properties_area_draw(const bContext *C, ARegion *ar)
        ED_region_panels(C, ar, 1, NULL, -1);
 }
 
-static void clip_properties_area_listener(ARegion *ar, wmNotifier *wmn)
+static void clip_properties_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index 81211e7bfefbc26628ae517742936695cead9d69..88a04197847302bbd94d7bdc3d531165430240ca 100644 (file)
@@ -359,7 +359,7 @@ static void console_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
-static void console_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void console_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        // SpaceInfo *sinfo = sa->spacedata.first;
 
index a31af851575dad27e16285be78b39b2c2f77a65c..85e4d255603693e874e8c444bcdcd6cb9e197b37 100644 (file)
@@ -667,7 +667,7 @@ bool autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v))
                                        
                                        BLI_join_dirfile(path, sizeof(path), dirname, de->d_name);
 
-                                       if (stat(path, &status) == 0) {
+                                       if (BLI_stat(path, &status) == 0) {
                                                if (S_ISDIR(status.st_mode)) { /* is subdir */
                                                        autocomplete_do_name(autocpl, path);
                                                }
index 56b0a5481bf79771ca5572530ac654368ecfa4b5..8b1df0f0d8f90864189b87ce94817d27f4c52f75 100644 (file)
@@ -255,7 +255,7 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa))
 
 }
 
-static void file_listener(ScrArea *sa, wmNotifier *wmn)
+static void file_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
        /* SpaceFile *sfile = (SpaceFile *)sa->spacedata.first; */
 
@@ -291,7 +291,7 @@ static void file_main_area_init(wmWindowManager *wm, ARegion *ar)
        WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
 }
 
-static void file_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void file_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -500,7 +500,7 @@ static void file_channel_area_draw(const bContext *C, ARegion *ar)
        ED_region_panels(C, ar, 1, NULL, -1);
 }
 
-static void file_channel_area_listener(ARegion *UNUSED(ar), wmNotifier *wmn)
+static void file_channel_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -560,7 +560,7 @@ static void file_ui_area_draw(const bContext *C, ARegion *ar)
        UI_view2d_view_restore(C);
 }
 
-static void file_ui_area_listener(ARegion *ar, wmNotifier *wmn)
+static void file_ui_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index 1a208ee2eb6149d3d34c442f3060a5ee3151ff03..6e38f236d019f39f6f6aee1630982c810af4d2e0 100644 (file)
@@ -384,7 +384,7 @@ static void graph_buttons_area_draw(const bContext *C, ARegion *ar)
        ED_region_panels(C, ar, 1, NULL, -1);
 }
 
-static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
+static void graph_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -438,7 +438,7 @@ static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
 }
 
 /* editor level listener */
-static void graph_listener(ScrArea *sa, wmNotifier *wmn)
+static void graph_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
        SpaceIpo *sipo = (SpaceIpo *)sa->spacedata.first;
        
index 679c1632eb1f9687c5c3ca347f695e45aedf3f1a..2b106e13836c086a32415428ae1e0c8c8870426d 100644 (file)
@@ -376,15 +376,10 @@ static void image_refresh(const bContext *C, ScrArea *sa)
        
        /* check if we have to set the image from the editmesh */
        if (ima && (ima->source == IMA_SRC_VIEWER && sima->mode == SI_MODE_MASK)) {
-               if (sima->lock == FALSE && G.moving) {
-                       /* pass */
-               }
-               else {
-                       if (scene->nodetree) {
-                               Mask *mask = ED_space_image_get_mask(sima);
-                               if (mask) {
-                                       ED_node_composite_job(C, scene->nodetree, scene);
-                               }
+               if (scene->nodetree) {
+                       Mask *mask = ED_space_image_get_mask(sima);
+                       if (mask) {
+                               ED_node_composite_job(C, scene->nodetree, scene);
                        }
                }
        }
@@ -420,7 +415,7 @@ static void image_refresh(const bContext *C, ScrArea *sa)
        }
 }
 
-static void image_listener(ScrArea *sa, wmNotifier *wmn)
+static void image_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
        SpaceImage *sima = (SpaceImage *)sa->spacedata.first;
        
@@ -731,7 +726,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar)
 #endif
 }
 
-static void image_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void image_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -765,7 +760,7 @@ static void image_buttons_area_draw(const bContext *C, ARegion *ar)
        ED_region_panels(C, ar, 1, NULL, -1);
 }
 
-static void image_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
+static void image_buttons_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -821,7 +816,7 @@ static void image_scope_area_draw(const bContext *C, ARegion *ar)
        ED_region_panels(C, ar, 1, NULL, -1);
 }
 
-static void image_scope_area_listener(ARegion *ar, wmNotifier *wmn)
+static void image_scope_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -858,7 +853,7 @@ static void image_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
-static void image_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void image_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index c68473820e3636f248d275d2ad8bb40835304fea..4e367c1d48d24c7eb13e46cbec07750b9bfc04b8 100644 (file)
@@ -422,8 +422,10 @@ void FILE_OT_report_missing_files(wmOperatorType *ot)
 static int find_missing_files_exec(bContext *C, wmOperator *op)
 {
        Main *bmain = CTX_data_main(C);
-       const char *searchpath = RNA_string_get_alloc(op->ptr, "filepath", NULL, 0);
-       BKE_bpath_missing_files_find(bmain, searchpath, op->reports);
+       const char *searchpath = RNA_string_get_alloc(op->ptr, "directory", NULL, 0);
+       const bool find_all = RNA_boolean_get(op->ptr, "find_all");
+
+       BKE_bpath_missing_files_find(bmain, searchpath, op->reports, find_all);
        MEM_freeN((void *)searchpath);
 
        return OPERATOR_FINISHED;
@@ -451,8 +453,10 @@ void FILE_OT_find_missing_files(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
        /* properties */
+       RNA_def_boolean(ot->srna, "find_all", false, "Find All", "Find all files in the search path (not just missing)");
+
        WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE,
-                                      WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
+                                      WM_FILESEL_DIRECTORY, FILE_DEFAULTDISPLAY);
 }
 
 /********************* report box operator *********************/
index 96ad6dee2df7ff8068b15b3b3f37fd03dfb0fcca..10b935502ba79f1b142f993cb76cd6668b452a5a 100644 (file)
@@ -233,7 +233,7 @@ static void info_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
-static void info_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void info_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        // SpaceInfo *sinfo = sa->spacedata.first;
 
@@ -248,7 +248,7 @@ static void info_main_area_listener(ARegion *ar, wmNotifier *wmn)
        }
 }
 
-static void info_header_listener(ARegion *ar, wmNotifier *wmn)
+static void info_header_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index a85fec7bf8727f271fd3cac99dfb754b8505f83e..fadf4c0b113afbf1bd34183156d69051e84eb281 100644 (file)
@@ -34,6 +34,7 @@
 #include "DNA_sensor_types.h"
 #include "DNA_controller_types.h"
 #include "DNA_actuator_types.h"
+#include "DNA_scene_types.h"
 
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
index 3f3c81f2bfab123737367b3a5274f763130959ce..4682bbc59ff96049bc155282aa89c64a6649ff1a 100644 (file)
@@ -194,7 +194,7 @@ static void logic_refresh(const bContext *UNUSED(C), ScrArea *UNUSED(sa))
 
 }
 
-static void logic_listener(ARegion *ar, wmNotifier *wmn)
+static void logic_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index 4ef84b3e7084ed5bf8f625e813f30bc47895889d..e54c1e8323a26d28958e5e0e9b19a3d2460cb4bf 100644 (file)
@@ -353,7 +353,7 @@ static void nla_buttons_area_draw(const bContext *C, ARegion *ar)
        ED_region_panels(C, ar, 1, NULL, -1);
 }
 
-static void nla_region_listener(ARegion *ar, wmNotifier *wmn)
+static void nla_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -386,7 +386,7 @@ static void nla_region_listener(ARegion *ar, wmNotifier *wmn)
 }
 
 
-static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void nla_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -430,7 +430,7 @@ static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn)
        }
 }
 
-static void nla_channel_area_listener(ARegion *ar, wmNotifier *wmn)
+static void nla_channel_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -465,7 +465,7 @@ static void nla_channel_area_listener(ARegion *ar, wmNotifier *wmn)
 }
 
 /* editor level listener */
-static void nla_listener(ScrArea *sa, wmNotifier *wmn)
+static void nla_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index 0ed803a7521d31833f79cb4daa86ca38c8b82b44..7da06bcf3a6e4ddfba629c76c1ca1661cb253b4a 100644 (file)
@@ -119,11 +119,11 @@ void ED_node_tag_update_id(ID *id)
                DAG_id_tag_update(id, 0);
                
                if (GS(id->name) == ID_MA)
-                       WM_main_add_notifier(NC_MATERIAL | ND_SHADING_DRAW, id);
+                       WM_main_add_notifier(NC_MATERIAL | ND_SHADING, id);
                else if (GS(id->name) == ID_LA)
-                       WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, id);
+                       WM_main_add_notifier(NC_LAMP | ND_LIGHTING, id);
                else if (GS(id->name) == ID_WO)
-                       WM_main_add_notifier(NC_WORLD | ND_WORLD_DRAW, id);
+                       WM_main_add_notifier(NC_WORLD | ND_WORLD, id);
        }
        else if (ntree->type == NTREE_COMPOSIT) {
                WM_main_add_notifier(NC_SCENE | ND_NODES, id);
index 89fa58cd75041e482e9bc2f64a3894627ed10153..e10cba43d718a9814beef74888aa47812630d295 100644 (file)
@@ -222,7 +222,7 @@ static void compo_updatejob(void *cjv)
                cj->need_sync = FALSE;
        }
 
-       WM_main_add_notifier(NC_WINDOW | ND_DRAW, NULL);
+       WM_main_add_notifier(NC_SCENE | ND_COMPO_RESULT, NULL);
 }
 
 static void compo_progressjob(void *cjv, float progress)
@@ -299,7 +299,7 @@ void ED_node_composite_job(const bContext *C, struct bNodeTree *nodetree, Scene
 
        /* setup job */
        WM_jobs_customdata_set(wm_job, cj, compo_freejob);
-       WM_jobs_timer(wm_job, 0.1, NC_SCENE, NC_SCENE | ND_COMPO_RESULT);
+       WM_jobs_timer(wm_job, 0.1, NC_SCENE | ND_COMPO_RESULT, NC_SCENE | ND_COMPO_RESULT);
        WM_jobs_callbacks(wm_job, compo_startjob, compo_initjob, compo_updatejob, NULL);
 
        WM_jobs_start(CTX_wm_manager(C), wm_job);
index d0d74059da812af15cb4b0e03670d6a6877910bf..07fa6997e993cbb11602d275d48a8d2e2a381865 100644 (file)
@@ -377,7 +377,7 @@ static void node_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa))
 
 }
 
-static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
+static void node_area_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
        /* note, ED_area_tag_refresh will re-execute compositor */
        SpaceNode *snode = sa->spacedata.first;
@@ -682,7 +682,7 @@ static void node_header_area_draw(const bContext *C, ARegion *ar)
 }
 
 /* used for header + main area */
-static void node_region_listener(ARegion *ar, wmNotifier *wmn)
+static void node_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index 9e458647aa2df759beecf3f251c7dfac45968a61..8da244b1db15dab108fd14bb1406d560c8295764 100644 (file)
@@ -262,7 +262,7 @@ static void outliner_main_area_free(ARegion *UNUSED(ar))
        
 }
 
-static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void outliner_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -378,7 +378,7 @@ static void outliner_header_area_free(ARegion *UNUSED(ar))
 {
 }
 
-static void outliner_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void outliner_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index a6c4ac231df7c20f29008e87bab0d055c8ee8e48..fd2cd268a270768957d544fe9f2a4e1f1b88bcb5 100644 (file)
@@ -178,7 +178,7 @@ static void script_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
-static void script_main_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
+static void script_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
 {
        /* context changes */
        // XXX - Todo, need the ScriptSpace accessible to get the python script to run.
index 20374e562e9becf9ec7ebe4996b8b288ea2d72b5..af4b40551567ad49a91be3de3aadb40392f76eba 100644 (file)
@@ -403,7 +403,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla
                glDisable(GL_BLEND);
        }
        
-       if (G.moving || (seq->flag & whichsel)) {
+       if ((G.moving & G_TRANSFORM_SEQ) || (seq->flag & whichsel)) {
                const char col[4] = {255, 255, 255, 255};
                if (direction == SEQ_LEFTHANDLE) {
                        BLI_snprintf(numstr, sizeof(numstr), "%d", seq->startdisp);
@@ -760,7 +760,7 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
        }
 
        get_seq_color3ubv(scene, seq, col);
-       if (G.moving && (seq->flag & SELECT)) {
+       if ((G.moving & G_TRANSFORM_SEQ) && (seq->flag & SELECT)) {
                if (seq->flag & SEQ_OVERLAP) {
                        col[0] = 255; col[1] = col[2] = 40;
                }
index 08848645bf9fb2edb199c8bf76059c5d83a1518c..04b2a21bf792be0901148a666c12d784f08ad3fe 100644 (file)
@@ -318,7 +318,7 @@ static SpaceLink *sequencer_duplicate(SpaceLink *sl)
        return (SpaceLink *)sseqn;
 }
 
-static void sequencer_listener(ScrArea *sa, wmNotifier *wmn)
+static void sequencer_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -480,7 +480,7 @@ static void sequencer_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
-static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void sequencer_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -555,7 +555,7 @@ static void sequencer_preview_area_draw(const bContext *C, ARegion *ar)
 
 }
 
-static void sequencer_preview_area_listener(ARegion *ar, wmNotifier *wmn)
+static void sequencer_preview_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -612,7 +612,7 @@ static void sequencer_buttons_area_draw(const bContext *C, ARegion *ar)
        ED_region_panels(C, ar, 1, NULL, -1);
 }
 
-static void sequencer_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
+static void sequencer_buttons_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index 92b6b78e53652bfa001d0b14a666b6c10a6cede2..e7fa4c05b9dccded9b8d6f185764631b1a679e0b 100644 (file)
@@ -116,7 +116,7 @@ static SpaceLink *text_duplicate(SpaceLink *sl)
        return (SpaceLink *)stextn;
 }
 
-static void text_listener(ScrArea *sa, wmNotifier *wmn)
+static void text_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
        SpaceText *st = sa->spacedata.first;
 
index ca6bab1d1daf894a3bc074600ae92a69b46b69d2..dec61a0e1ca76b9324caf451484d1cddc55955d5 100644 (file)
@@ -486,7 +486,7 @@ static void txt_write_file(Text *text, ReportList *reports)
        
        fclose(fp);
 
-       if (stat(filepath, &st) == 0) {
+       if (BLI_stat(filepath, &st) == 0) {
                text->mtime = st.st_mtime;
        }
        else {
@@ -3107,7 +3107,7 @@ int text_file_modified(Text *text)
        if (!BLI_exists(file))
                return 2;
 
-       result = stat(file, &st);
+       result = BLI_stat(file, &st);
        
        if (result == -1)
                return -1;
@@ -3134,7 +3134,7 @@ static void text_ignore_modified(Text *text)
 
        if (!BLI_exists(file)) return;
 
-       result = stat(file, &st);
+       result = BLI_stat(file, &st);
        
        if (result == -1 || (st.st_mode & S_IFMT) != S_IFREG)
                return;
index 0f798aa18930b684b2764bb9a20d8f3f37a6f15c..8258d7178894e0d0cb6ba0bc99bf80983a96873e 100644 (file)
@@ -397,7 +397,7 @@ static void time_refresh(const bContext *UNUSED(C), ScrArea *sa)
 }
 
 /* editor level listener */
-static void time_listener(ScrArea *sa, wmNotifier *wmn)
+static void time_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 {
 
        /* mainly for updating cache display */
@@ -523,7 +523,7 @@ static void time_main_area_draw(const bContext *C, ARegion *ar)
        UI_view2d_scrollers_free(scrollers);
 }
 
-static void time_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void time_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -563,7 +563,7 @@ static void time_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
-static void time_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void time_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
index 5ebbebec35b4ad8e040371d6ef09b924bdbde923..0bd094b6a33eb06cf414f54134628be3e6aeaaf9 100644 (file)
@@ -138,12 +138,12 @@ static void userpref_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
-static void userpref_main_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
+static void userpref_main_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
 {
        /* context changes */
 }
 
-static void userpref_header_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
+static void userpref_header_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar), wmNotifier *UNUSED(wmn))
 {
        /* context changes */
 #if 0
index d0a34f20c773231e33683b90465b4c69f3be7208..6a836c4af13190d8dfcaf0760c0d8fc12f5b81c6 100644 (file)
@@ -89,6 +89,7 @@ typedef struct drawEMTFMapped_userData {
 } drawEMTFMapped_userData;
 
 typedef struct drawTFace_userData {
+       Mesh *me;
        MFace *mf;
        MTFace *tf;
 } drawTFace_userData;
@@ -538,7 +539,7 @@ static void update_tface_color_layer(DerivedMesh *dm)
 
 static DMDrawOption draw_tface_mapped__set_draw(void *userData, int index)
 {
-       Mesh *me = (Mesh *)userData;
+       Mesh *me = ((drawTFace_userData *)userData)->me;
 
        /* array checked for NULL before calling */
        MPoly *mpoly = &me->mpoly[index];
@@ -735,6 +736,7 @@ static int compareDrawOptions(void *userData, int cur_index, int next_index)
        return 1;
 }
 
+
 static int compareDrawOptionsEm(void *userData, int cur_index, int next_index)
 {
        drawEMTFMapped_userData *data = userData;
@@ -777,8 +779,14 @@ static void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d
                if (ob->mode & OB_MODE_WEIGHT_PAINT)
                        dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions_facemask, GPU_enable_material, NULL, me,
                                            DM_DRAW_USE_COLORS | DM_DRAW_ALWAYS_SMOOTH);
-               else
-                       dm->drawMappedFacesTex(dm, me->mpoly ? draw_tface_mapped__set_draw : NULL, NULL, me);
+               else {
+                       drawTFace_userData userData;
+
+                       userData.mf = DM_get_tessface_data_layer(dm, CD_MFACE);
+                       userData.tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
+                       userData.me = me;
+                       dm->drawMappedFacesTex(dm, me->mpoly ? draw_tface_mapped__set_draw : NULL, compareDrawOptions, &userData);
+               }
        }
        else {
                if (GPU_buffer_legacy(dm)) {
@@ -794,6 +802,7 @@ static void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d
 
                        userData.mf = DM_get_tessface_data_layer(dm, CD_MFACE);
                        userData.tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
+                       userData.me = NULL;
 
                        dm->drawFacesTex(dm, draw_tface__set_draw, compareDrawOptions, &userData);
                }
index 79ad62ee2e89a9db47f46e3d7635ec65e4b40c8e..1ce8cf9082eba8853617a0f9a6a24edbe786bb0b 100644 (file)
@@ -2685,7 +2685,7 @@ static void draw_em_measure_stats(ARegion *ar, View3D *v3d, Object *ob, BMEditMe
        float grid = unit->system ? unit->scale_length : v3d->grid;
        const bool do_split = (unit->flag & USER_UNIT_OPT_SPLIT) != 0;
        const bool do_global = (v3d->flag & V3D_GLOBAL_STATS) != 0;
-       const bool do_moving = G.moving;
+       const bool do_moving = (G.moving & G_TRANSFORM_EDIT) != 0;
        float clip_planes[4][4];
 
        BMIter iter;
@@ -3004,7 +3004,7 @@ static void draw_em_fancy(Scene *scene, ARegion *ar, View3D *v3d,
 {
        RegionView3D *rv3d = ar->regiondata;
        Mesh *me = ob->data;
-       BMFace *efa_act = BM_active_face_get(em->bm, false, true); /* annoying but active faces is stored differently */
+       BMFace *efa_act = BM_mesh_active_face_get(em->bm, false, true); /* annoying but active faces is stored differently */
        BMEdge *eed_act = NULL;
        BMVert *eve_act = NULL;
        
index 4c888f2f6c6d75187011b5f5d183f1a43f9fb13c..fef534fa5f2fefc40ce660872afc419b2f4e893a 100644 (file)
@@ -380,11 +380,10 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
        
 // XXX BIF_view3d_previewrender_free(v3do);
        
-       if (v3do->localvd) {
-               v3do->localvd = NULL;
-               v3do->properties_storage = NULL;
-               v3do->lay = v3dn->localvd->lay;
-               v3do->lay &= 0xFFFFFF;
+       if (v3dn->localvd) {
+               v3dn->localvd = NULL;
+               v3dn->properties_storage = NULL;
+               v3dn->lay = v3do->localvd->lay & 0xFFFFFF;
        }
 
        if (v3dn->drawtype == OB_RENDER)
@@ -710,8 +709,10 @@ static void view3d_recalc_used_layers(ARegion *ar, wmNotifier *wmn, Scene *scene
        }
 }
 
-static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void view3d_main_area_listener(bScreen *sc, ScrArea *sa, ARegion *ar, wmNotifier *wmn)
 {
+       Scene *scene = sc->scene;
+       View3D *v3d = sa->spacedata.first;
        
        /* context changes */
        switch (wmn->category) {
@@ -800,6 +801,14 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
                        break;
                case NC_MATERIAL:
                        switch (wmn->data) {
+                               case ND_SHADING:
+                               case ND_NODES:
+                                       if ((v3d->drawtype == OB_MATERIAL) ||
+                                           (v3d->drawtype == OB_TEXTURE && scene->gm.matmode == GAME_MAT_GLSL))
+                                       {
+                                               ED_region_tag_redraw(ar);
+                                       }
+                                       break;
                                case ND_SHADING_DRAW:
                                case ND_SHADING_LINKS:
                                        ED_region_tag_redraw(ar);
@@ -823,7 +832,11 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
                case NC_LAMP:
                        switch (wmn->data) {
                                case ND_LIGHTING_DRAW:
-                                       ED_region_tag_redraw(ar);
+                                       if ((v3d->drawtype == OB_MATERIAL) ||
+                                           (v3d->drawtype == OB_TEXTURE && (scene->gm.matmode == GAME_MAT_GLSL)))
+                                       {
+                                               ED_region_tag_redraw(ar);
+                                       }
                                        break;
                        }
                        break;
@@ -908,7 +921,7 @@ static void view3d_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
-static void view3d_header_area_listener(ARegion *ar, wmNotifier *wmn)
+static void view3d_header_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -949,7 +962,7 @@ static void view3d_buttons_area_draw(const bContext *C, ARegion *ar)
        ED_region_panels(C, ar, 1, NULL, -1);
 }
 
-static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
+static void view3d_buttons_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -1049,7 +1062,7 @@ static void view3d_tools_area_draw(const bContext *C, ARegion *ar)
        ED_region_panels(C, ar, 1, CTX_data_mode_string(C), -1);
 }
 
-static void view3d_props_area_listener(ARegion *ar, wmNotifier *wmn)
+static void view3d_props_area_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch (wmn->category) {
@@ -1069,7 +1082,7 @@ static void view3d_props_area_listener(ARegion *ar, wmNotifier *wmn)
 }
 
 /*area (not region) level listener*/
-static void space_view3d_listener(ScrArea *sa, struct wmNotifier *wmn)
+static void space_view3d_listener(bScreen *UNUSED(sc), ScrArea *sa, struct wmNotifier *wmn)
 {
        View3D *v3d = sa->spacedata.first;
 
index 5417389384740aa79ec7096a5d8b79f3cca831da..860807946a097192f87410eb6594f74acf0e8d34 100644 (file)
@@ -779,57 +779,6 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 #define B_VGRP_PNL_COPY_SINGLE    8192 /* or greater */
 #define B_VGRP_PNL_ACTIVE        16384 /* or greater */
 
-
-static MDeformVert *ED_mesh_active_dvert_get_ob(Object *ob, int *r_index)
-{
-       Mesh *me = ob->data;
-       int index = BKE_mesh_mselect_active_get(me, ME_VSEL);
-       if (r_index) *r_index = index;
-       if (index == -1 || me->dvert == NULL) {
-               return NULL;
-       }
-       else {
-               return me->dvert + index;
-       }
-}
-
-static MDeformVert *ED_mesh_active_dvert_get_em(Object *ob, BMVert **r_eve)
-{
-       if (ob->mode & OB_MODE_EDIT && ob->type == OB_MESH && ob->defbase.first) {
-               Mesh *me = ob->data;
-               BMEditMesh *em = me->edit_btmesh;
-               const int cd_dvert_offset = CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT);
-
-               if (cd_dvert_offset != -1) {
-                       BMEditSelection *ese = (BMEditSelection *)em->bm->selected.last;
-
-                       if (ese && ese->htype == BM_VERT) {
-                               BMVert *eve = (BMVert *)ese->ele;
-                               if (r_eve) *r_eve = eve;
-                               return BM_ELEM_CD_GET_VOID_P(eve, cd_dvert_offset);
-                       }
-               }
-       }
-
-       if (r_eve) *r_eve = NULL;
-       return NULL;
-}
-
-static MDeformVert *ED_mesh_active_dvert_get_only(Object *ob)
-{
-       if (ob->type == OB_MESH) {
-               if (ob->mode & OB_MODE_EDIT) {
-                       return ED_mesh_active_dvert_get_em(ob, NULL);
-               }
-               else {
-                       return ED_mesh_active_dvert_get_ob(ob, NULL);
-               }
-       }
-       else {
-               return NULL;
-       }
-}
-
 static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
 {
        if (event < B_VGRP_PNL_EDIT_SINGLE) {
@@ -883,7 +832,6 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
 
                uiLayout *col, *bcol;
                uiLayout *row;
-               uiLayout *box;
                uiBut *but;
                bDeformGroup *dg;
                unsigned int i;
@@ -891,6 +839,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
                const bool *vgroup_validmap;
                eVGroupSelect subset_type = ts->vgroupsubset;
                int yco = 0;
+               int locked = 0;
 
                uiBlockSetHandleFunc(block, do_view3d_vgroup_buttons, NULL);
 
@@ -901,9 +850,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
                uiItemR(row, &tools_ptr, "vertex_group_subset", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
 
                col = uiLayoutColumn(bcol, true);
-               box = uiLayoutBox(col); /* The list box */
 
-               col = uiLayoutColumn(box, true);
                vgroup_validmap = ED_vgroup_subset_from_select_type(ob, subset_type, &vgroup_tot, &subset_count);
                for (i = 0, dg = ob->defbase.first; dg; i++, dg = dg->next) {
                        if (vgroup_validmap[i]) {
@@ -912,8 +859,6 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
                                        int x, xco = 0;
                                        row = uiLayoutRow(col, true);
 
-                                       uiBlockSetEmboss(block, UI_EMBOSSN);
-
                                        /* The Weight Group Name */
 
                                        ot = ot_weight_set_active;
@@ -921,7 +866,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
                                                            xco, yco, (x = UI_UNIT_X * 5), UI_UNIT_Y, "");
                                        but_ptr = uiButGetOperatorPtrRNA(but);
                                        RNA_int_set(but_ptr, "weight_group", i);
-                                       uiButSetFlag(but, UI_TEXT_LEFT);
+                                       uiButSetFlag(but, UI_TEXT_RIGHT);
                                        if (ob->actdef != i + 1) {
                                                uiButSetFlag(but, UI_BUT_INACTIVE);
                                        }
@@ -930,9 +875,13 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
                                        /* The weight group value */
                                        /* To be reworked still */
                                        but = uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + i, "",
-                                                 xco, yco, (x = UI_UNIT_X * 4), UI_UNIT_Y,
-                                                 &dw->weight, 0.0, 1.0, 1, 3, "");
+                                                       xco, yco, (x = UI_UNIT_X * 4), UI_UNIT_Y,
+                                                       &dw->weight, 0.0, 1.0, 1, 3, "");
                                        uiButSetFlag(but, UI_TEXT_LEFT);
+                                       if (dg->flag & DG_LOCK_WEIGHT) {
+                                               uiButSetFlag(but, UI_BUT_DISABLED);
+                                               locked++;
+                                       }
                                        xco += x;
 
                                        /* The weight group paste function */
@@ -956,22 +905,23 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
                }
                MEM_freeN((void *)vgroup_validmap);
 
-               uiBlockSetEmboss(block, UI_EMBOSS);
-
                yco -= 2;
 
                col = uiLayoutColumn(pa->layout, true);
                row = uiLayoutRow(col, true);
 
-               ot = WM_operatortype_find("OBJECT_OT_vertex_weight_normalize_active", 1);
-               but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, "Normalize", 
-                               0, yco,UI_UNIT_X * 5, UI_UNIT_Y,
-                               TIP_("Normalize active vertex weights"));
+               ot = WM_operatortype_find("OBJECT_OT_vertex_weight_normalize_active_vertex", 1);
+               but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, "Normalize",
+                                   0, yco, UI_UNIT_X * 5, UI_UNIT_Y,
+                                   TIP_("Normalize weights of active vertex (if affected groups are unlocked"));
+               if (locked) {
+                       uiButSetFlag(but, UI_BUT_DISABLED);
+               }
 
                ot = WM_operatortype_find("OBJECT_OT_vertex_weight_copy", 1);
-               but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, "Copy", 
-                               UI_UNIT_X * 5, yco,UI_UNIT_X * 5, UI_UNIT_Y, 
-                               TIP_("Copy active vertex to other selected verts"));
+               but = uiDefButO_ptr(block, BUT, ot, WM_OP_EXEC_DEFAULT, "Copy",
+                                   UI_UNIT_X * 5, yco, UI_UNIT_X * 5, UI_UNIT_Y,
+                                   TIP_("Copy active vertex to other selected verts"));
 
        }
 }
index 6bab677fb61db227a0db1b2ce336ddc02f4b566a..659c9a6c2e679002cbec4dc2377702e57571791c 100644 (file)
@@ -345,7 +345,7 @@ static bool initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, const wmEvent
 
        fly->rv3d->rflag |= RV3D_NAVIGATING; /* so we draw the corner margins */
 
-       /* detect weather to start with Z locking */
+       /* detect whether to start with Z locking */
        upvec[0] = 1.0f;
        upvec[1] = 0.0f;
        upvec[2] = 0.0f;
index 180686b4b82efebf94fb63aea344064d0883ac24..0490d8763d8ff43616a42be4bd72347ec1639544 100644 (file)
@@ -30,6 +30,7 @@
 #include "DNA_mesh_types.h"
 #include "DNA_armature_types.h"
 #include "DNA_object_types.h"
+#include "DNA_scene_types.h"
 
 #include "BLI_utildefines.h"
 #include "BLI_listbase.h"
index 53ecfe3a685f7a4aabbd5f1b065f3f066c84826b..d160e1562b00b837277b1099109e498af0c3fe7f 100644 (file)
@@ -604,6 +604,7 @@ int calc_manipulator_stats(const struct bContext *C);
 void createTransData(struct bContext *C, TransInfo *t);
 void sort_trans_data_dist(TransInfo *t);
 void special_aftertrans_update(struct bContext *C, TransInfo *t);
+int  special_transform_moving(TransInfo *t);
 
 void transform_autoik_update(TransInfo *t, short mode);
 
index 1df5a7e323cbbffb05c6a3dab272a51f259ab8ff..44c2158bf74c3ea1e57b6f46a8b31b2d3f56a9c5 100644 (file)
@@ -2110,12 +2110,7 @@ static void createTransEditVerts(TransInfo *t)
        }
 
        /* check active */
-       if (em->bm->selected.last) {
-               BMEditSelection *ese = em->bm->selected.last;
-               if (ese->htype == BM_VERT) {
-                       eve_act = (BMVert *)ese->ele;
-               }
-       }
+       eve_act = BM_mesh_active_vert_get(bm);
 
        if (t->mode == TFM_BWEIGHT) {
                BM_mesh_cd_flag_ensure(bm, BKE_mesh_from_object(t->obedit), ME_CDFLAG_VERT_BWEIGHT);
@@ -5706,6 +5701,21 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
 #endif
 }
 
+int special_transform_moving(TransInfo *t)
+{
+       if (t->spacetype == SPACE_SEQ) {
+               return G_TRANSFORM_SEQ;
+       }
+       else if (t->obedit || ((t->flag & T_POSE) && (t->poseobj))) {
+               return G_TRANSFORM_EDIT;
+       }
+       else if (t->flag & (T_OBJECT | T_TEXTURE)) {
+               return G_TRANSFORM_OBJ;
+       }
+
+       return 0;
+}
+
 static void createTransObject(bContext *C, TransInfo *t)
 {
        TransData *td = NULL;
index 7afced78746ebcc172cf9e125a22fe9033c2150b..666612880e590233a49e438c202eeaa4dc067bed 100644 (file)
@@ -1047,12 +1047,6 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *even
        Object *obedit = CTX_data_edit_object(C);
        PropertyRNA *prop;
        
-       /* moving: is shown in drawobject() (transform color) */
-//  TRANSFORM_FIX_ME
-//     if (obedit || (t->flag & T_POSE) ) G.moving = G_TRANSFORM_EDIT;
-//     else if (G.f & G_PARTICLEEDIT) G.moving = G_TRANSFORM_PARTICLE;
-//     else G.moving = G_TRANSFORM_OBJ;
-       
        t->scene = sce;
        t->sa = sa;
        t->ar = ar;