Merging r58362 through r58463 from trunk into soc-2013-depsgraph_mt
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 21 Jul 2013 08:14:59 +0000 (08:14 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 21 Jul 2013 08:14:59 +0000 (08:14 +0000)
200 files changed:
CMakeLists.txt
intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
intern/cycles/blender/addon/presets.py
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_object.cpp
intern/cycles/blender/blender_sync.cpp
intern/cycles/device/device_cpu.cpp
intern/cycles/render/session.cpp
intern/cycles/util/util_task.cpp
intern/cycles/util/util_task.h
intern/ghost/intern/GHOST_DropTargetX11.cpp
intern/ghost/intern/GHOST_SystemCarbon.cpp
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h
intern/ghost/intern/GHOST_WindowCocoa.mm
release/datafiles/LICENSE-droidsans.ttf.txt
release/datafiles/fonts/droidsans.ttf.gz
release/datafiles/splash.png
release/scripts/presets/cycles/sampling/final.py [new file with mode: 0644]
release/scripts/presets/cycles/sampling/preview.py [new file with mode: 0644]
release/scripts/startup/bl_ui/properties_data_curve.py
release/scripts/startup/bl_ui/properties_mask_common.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_key.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/deform.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/fmodifier.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/linestyle.c
source/blender/blenkernel/intern/mask_rasterize.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/navmesh_conversion.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/BLI_mempool.c
source/blender/blenlib/intern/DLRB_tree.c
source/blender/blenlib/intern/math_geom.c
source/blender/blenlib/intern/math_rotation.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/storage.c
source/blender/blenloader/intern/readfile.c
source/blender/bmesh/intern/bmesh_operators.c
source/blender/bmesh/operators/bmo_create.c
source/blender/bmesh/operators/bmo_dupe.c
source/blender/bmesh/operators/bmo_extrude.c
source/blender/collada/MeshImporter.cpp
source/blender/collada/TransformWriter.cpp
source/blender/collada/collada_utils.cpp
source/blender/compositor/intern/COM_ExecutionGroup.cpp
source/blender/compositor/nodes/COM_GroupNode.cpp
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/drivers.c
source/blender/editors/animation/fmodifier_ui.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/armature_intern.h
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/armature_select.c
source/blender/editors/armature/pose_slide.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mask/mask_edit.c
source/blender/editors/mask/mask_intern.h
source/blender/editors/mask/mask_select.c
source/blender/editors/mesh/editmesh_loopcut.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/meshtools.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_action/action_draw.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_templates.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ops.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_constraints.c
source/blender/editors/util/CMakeLists.txt
source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
source/blender/gpu/intern/gpu_material.c
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/jpeg.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_wm.c
source/blender/modifiers/intern/MOD_shapekey.c
source/blender/nodes/NOD_static_types.h
source/blender/nodes/intern/node_socket.c
source/blender/nodes/shader/nodes/node_shader_math.c
source/blender/nodes/shader/nodes/node_shader_particle_info.c
source/blender/python/bmesh/bmesh_py_types_meshdata.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/wm_event_types.h
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.h
source/gameengine/Converter/KX_ConvertProperties.cpp
source/gameengine/Expressions/KX_HashedPtr.cpp
source/gameengine/GameLogic/SCA_IScene.cpp
source/gameengine/GameLogic/SCA_IScene.h
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GamePlayer/CMakeLists.txt
source/gameengine/GamePlayer/common/CMakeLists.txt
source/gameengine/GamePlayer/common/GPC_Canvas.cpp
source/gameengine/GamePlayer/common/GPC_Canvas.h
source/gameengine/GamePlayer/common/GPC_Engine.cpp [deleted file]
source/gameengine/GamePlayer/common/GPC_Engine.h [deleted file]
source/gameengine/GamePlayer/common/GPC_RawImage.cpp [deleted file]
source/gameengine/GamePlayer/common/GPC_RawImage.h [deleted file]
source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.cpp [deleted file]
source/gameengine/GamePlayer/common/GPC_RawLoadDotBlendArray.h [deleted file]
source/gameengine/GamePlayer/common/GPC_RawLogoArrays.cpp [deleted file]
source/gameengine/GamePlayer/common/GPC_RawLogoArrays.h [deleted file]
source/gameengine/GamePlayer/common/GPC_System.cpp [deleted file]
source/gameengine/GamePlayer/common/GPC_System.h [deleted file]
source/gameengine/GamePlayer/common/SConscript
source/gameengine/GamePlayer/common/bmfont.cpp [deleted file]
source/gameengine/GamePlayer/common/load.blend [deleted file]
source/gameengine/GamePlayer/common/logo_blender.raw [deleted file]
source/gameengine/GamePlayer/common/logo_blender3d.raw [deleted file]
source/gameengine/GamePlayer/common/logo_nan.raw [deleted file]
source/gameengine/GamePlayer/ghost/CMakeLists.txt
source/gameengine/GamePlayer/ghost/GPG_Application.cpp
source/gameengine/GamePlayer/ghost/GPG_Canvas.cpp
source/gameengine/GamePlayer/ghost/GPG_System.h
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/GamePlayer/ghost/SConscript
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Ketsji/KX_FontObject.cpp
source/gameengine/Ketsji/KX_FontObject.h
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_IPO_SGController.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.h
source/gameengine/Ketsji/KX_PhysicsPropertiesobsolete.h [deleted file]
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_Scene.h
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Rasterizer/RAS_2DFilterManager.cpp

index b1a7830434e4198f8e88bcfadcbef79546dcdd2e..e91ec18caee7fddd150d7603b6ae7655853c1603 100644 (file)
@@ -538,9 +538,6 @@ set(PLATFORM_LINKFLAGS "")
 set(PLATFORM_LINKFLAGS_DEBUG "")
 
 
-# disabled for now, not supported
-# option(WITH_WEBPLUGIN     "Enable Web Plugin (Unix only)" OFF)
-
 # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
 # On Unix:
 #   cmake ../blender \
@@ -1874,16 +1871,6 @@ if(WITH_IMAGE_REDCODE)
        set(REDCODE_INC ${REDCODE})
 endif()
 
-#-----------------------------------------------------------------------------
-# Blender WebPlugin
-
-if(WITH_WEBPLUGIN)
-       set(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
-       set(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none")
-
-       set(WITH_PLAYER ON)
-endif()
-
 
 #-----------------------------------------------------------------------------
 # Configure OpenGL.
@@ -1977,6 +1964,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_NULL -Wnonnull)  # C only
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
 
        # gcc 4.2 gives annoying warnings on every file with this
        if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -2003,6 +1991,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self)  # needs -Wuninitialized
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
+       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits)
 
        # gcc 4.2 gives annoying warnings on every file with this
        if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
index 3d830df83e8e1fe3a97ef4f694370991cbaad1c5..ba961f0cb78c4be9162f3e63127bc90d9cb6148f 100644 (file)
@@ -347,10 +347,6 @@ void AUD_FFMPEGReader::seek(int position)
                uint64_t st_time = m_formatCtx->start_time;
                uint64_t seek_pos = ((uint64_t)position) * ((uint64_t)AV_TIME_BASE) / ((uint64_t)m_specs.rate);
 
-               if (seek_pos < 0) {
-                       seek_pos = 0;
-               }
-
                if (st_time != AV_NOPTS_VALUE) {
                        seek_pos += st_time;
                }
index e2836b2cc21d53d86280d35edff990283401cd09..d1f8e7c3a6defa190ff9979aeeb98812abbf7b5e 100644 (file)
@@ -46,6 +46,36 @@ class AddPresetIntegrator(AddPresetBase, Operator):
     preset_subdir = "cycles/integrator"
 
 
+class AddPresetSampling(AddPresetBase, Operator):
+    '''Add a Sampling Preset'''
+    bl_idname = "render.cycles_sampling_preset_add"
+    bl_label = "Add Sampling Preset"
+    preset_menu = "CYCLES_MT_sampling_presets"
+
+    preset_defines = [
+        "cycles = bpy.context.scene.cycles"
+    ]
+
+    preset_values = [
+        "cycles.samples",
+        "cycles.preview_samples",
+        "cycles.aa_samples",
+        "cycles.preview_aa_samples",
+        "cycles.diffuse_samples",
+        "cycles.glossy_samples",
+        "cycles.transmission_samples",
+        "cycles.ao_samples",
+        "cycles.mesh_light_samples",
+        "cycles.subsurface_samples",
+        "cycles.no_caustics",
+        "cycles.blur_glossy",
+        "cycles.squared_samples",
+        "cycles.progressive"
+    ]
+
+    preset_subdir = "cycles/sampling"
+
+
 def register():
     pass
 
index ca49ffccd2a59415d3f5cc4241aba5c49ca0efbf..eba94604a88c436b804f16f9e27ec5fd5c698e06 100644 (file)
@@ -150,6 +150,11 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
                 description="Use progressive sampling of lighting",
                 default=True,
                 )
+        cls.squared_samples = BoolProperty(
+                name="Squared Samples",
+                description="Square sampling values for easier artist control",
+                default=False,
+                )
 
         cls.samples = IntProperty(
                 name="Samples",
index 8d129aa821c3bed6057d05fface262a485dda3dc..1a17675cb71d83084f8318f2c0e689b0ec9399e5 100644 (file)
@@ -23,6 +23,14 @@ import bpy
 from bpy.types import Panel, Menu, Operator
 
 
+class CYCLES_MT_sampling_presets(Menu):
+    bl_label = "Sampling Presets"
+    preset_subdir = "cycles/sampling"
+    preset_operator = "script.execute_preset"
+    COMPAT_ENGINES = {'CYCLES'}
+    draw = Menu.draw_preset
+
+
 class CYCLES_MT_integrator_presets(Menu):
     bl_label = "Integrator Presets"
     preset_subdir = "cycles/integrator"
@@ -52,22 +60,30 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
         scene = context.scene
         cscene = scene.cycles
         device_type = context.user_preferences.system.compute_device_type
+        
+        row = layout.row(align=True)
+        row.menu("CYCLES_MT_sampling_presets", text=bpy.types.CYCLES_MT_sampling_presets.bl_label)
+        row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMIN")
+        row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMOUT").remove_active = True
 
-        split = layout.split()
-
-        col = split.column()
-        sub = col.column()
+        row = layout.row()
+        sub = row.row()
         sub.active = (device_type == 'NONE' or cscene.device == 'CPU')
         sub.prop(cscene, "progressive")
-
+        row.prop(cscene, "squared_samples")
+        
+        split = layout.split()
+        
+        col = split.column()
         sub = col.column(align=True)
+        sub.label("Settings:")
         sub.prop(cscene, "seed")
         sub.prop(cscene, "sample_clamp")
 
         if cscene.progressive or (device_type != 'NONE' and cscene.device == 'GPU'):
             col = split.column()
-            col.label(text="Samples:")
             sub = col.column(align=True)
+            sub.label(text="Samples:")
             sub.prop(cscene, "samples", text="Render")
             sub.prop(cscene, "preview_samples", text="Preview")
         else:
@@ -76,8 +92,8 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
             sub.prop(cscene, "preview_aa_samples", text="Preview")
 
             col = split.column()
-            col.label(text="Samples:")
             sub = col.column(align=True)
+            sub.label(text="Samples:")
             sub.prop(cscene, "diffuse_samples", text="Diffuse")
             sub.prop(cscene, "glossy_samples", text="Glossy")
             sub.prop(cscene, "transmission_samples", text="Transmission")
index d1e3d64d572739ed238c124872c994bacf5cff5d..b2235c36af037b51fa2bbba4492003deb0e00693 100644 (file)
@@ -154,10 +154,16 @@ void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSI
        light->shader = used_shaders[0];
 
        /* shadow */
+       PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
        PointerRNA clamp = RNA_pointer_get(&b_lamp.ptr, "cycles");
        light->cast_shadow = get_boolean(clamp, "cast_shadow");
        light->use_mis = get_boolean(clamp, "use_multiple_importance_sampling");
-       light->samples = get_int(clamp, "samples");
+       
+       int samples = get_int(clamp, "samples");
+       if(get_boolean(cscene, "squared_samples"))
+               light->samples = samples * samples;
+       else
+               light->samples = samples;
 
        /* visibility */
        uint visibility = object_ray_visibility(b_ob);
@@ -174,6 +180,7 @@ void BlenderSync::sync_background_light()
        BL::World b_world = b_scene.world();
 
        if(b_world) {
+               PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
                PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
                bool sample_as_light = get_boolean(cworld, "sample_as_light");
 
@@ -188,8 +195,13 @@ void BlenderSync::sync_background_light()
                        {
                                light->type = LIGHT_BACKGROUND;
                                light->map_resolution  = get_int(cworld, "sample_map_resolution");
-                               light->samples  = get_int(cworld, "samples");
                                light->shader = scene->default_background;
+                               
+                               int samples = get_int(cworld, "samples");
+                               if(get_boolean(cscene, "squared_samples"))
+                                       light->samples = samples * samples;
+                               else
+                                       light->samples = samples;
 
                                light->tag_update(scene);
                                light_map.set_recalc(b_world);
index 72ed1b84915b4ebf0289b2bc3e79891ad0e7d650..11e2be5e0fb0cd483f8e7d6540d86297a4979fcc 100644 (file)
@@ -191,14 +191,33 @@ void BlenderSync::sync_integrator()
        }
 #endif
 
-       integrator->diffuse_samples = get_int(cscene, "diffuse_samples");
-       integrator->glossy_samples = get_int(cscene, "glossy_samples");
-       integrator->transmission_samples = get_int(cscene, "transmission_samples");
-       integrator->ao_samples = get_int(cscene, "ao_samples");
-       integrator->mesh_light_samples = get_int(cscene, "mesh_light_samples");
-       integrator->subsurface_samples = get_int(cscene, "subsurface_samples");
        integrator->progressive = get_boolean(cscene, "progressive");
 
+       int diffuse_samples = get_int(cscene, "diffuse_samples");
+       int glossy_samples = get_int(cscene, "glossy_samples");
+       int transmission_samples = get_int(cscene, "transmission_samples");
+       int ao_samples = get_int(cscene, "ao_samples");
+       int mesh_light_samples = get_int(cscene, "mesh_light_samples");
+       int subsurface_samples = get_int(cscene, "subsurface_samples");
+
+       if(get_boolean(cscene, "squared_samples")) {
+               integrator->diffuse_samples = diffuse_samples * diffuse_samples;
+               integrator->glossy_samples = glossy_samples * glossy_samples;
+               integrator->transmission_samples = transmission_samples * transmission_samples;
+               integrator->ao_samples = ao_samples * ao_samples;
+               integrator->mesh_light_samples = mesh_light_samples * mesh_light_samples;
+               integrator->subsurface_samples = subsurface_samples * subsurface_samples;
+       } 
+       else {
+               integrator->diffuse_samples = diffuse_samples;
+               integrator->glossy_samples = glossy_samples;
+               integrator->transmission_samples = transmission_samples;
+               integrator->ao_samples = ao_samples;
+               integrator->mesh_light_samples = mesh_light_samples;
+               integrator->subsurface_samples = subsurface_samples;
+       }
+       
+
        if(experimental)
                integrator->sampling_pattern = (SamplingPattern)RNA_enum_get(&cscene, "sampling_pattern");
 
@@ -300,8 +319,13 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer)
                        render_layer.use_localview = false;
 
                        render_layer.bound_samples = (use_layer_samples == 1);
-                       if(use_layer_samples != 2)
-                               render_layer.samples = b_rlay->samples();
+                       if(use_layer_samples != 2) {
+                               int samples = b_rlay->samples();
+                               if(get_boolean(cscene, "squared_samples"))
+                                       render_layer.samples = samples * samples;
+                               else
+                                       render_layer.samples = samples;
+                       }
                }
 
                first_layer = false;
@@ -385,24 +409,36 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
        params.background = background;
 
        /* samples */
+       int samples = get_int(cscene, "samples");
+       int aa_samples = get_int(cscene, "aa_samples");
+       int preview_samples = get_int(cscene, "preview_samples");
+       int preview_aa_samples = get_int(cscene, "preview_aa_samples");
+       
+       if(get_boolean(cscene, "squared_samples")) {
+               samples = samples * samples;
+               aa_samples = aa_samples * aa_samples;
+               preview_samples = preview_samples * preview_samples;
+               preview_aa_samples = preview_aa_samples * preview_aa_samples;
+       }
+
        if(get_boolean(cscene, "progressive") == 0 && params.device.type == DEVICE_CPU) {
                if(background) {
-                       params.samples = get_int(cscene, "aa_samples");
+                       params.samples = aa_samples;
                }
                else {
-                       params.samples = get_int(cscene, "preview_aa_samples");
+                       params.samples = preview_aa_samples;
                        if(params.samples == 0)
-                               params.samples = INT_MAX;
+                               params.samples = USHRT_MAX;
                }
        }
        else {
                if(background) {
-                       params.samples = get_int(cscene, "samples");
+                       params.samples = samples;
                }
                else {
-                       params.samples = get_int(cscene, "preview_samples");
+                       params.samples = preview_samples;
                        if(params.samples == 0)
-                               params.samples = INT_MAX;
+                               params.samples = USHRT_MAX;
                }
        }
 
index 95df2e216081e02e357cf69cd96f68e76f9f37d7..7bc84878dab6511df007fd1b5c6bc5fd0d1d48ae 100644 (file)
@@ -307,8 +307,7 @@ public:
 
        void task_add(DeviceTask& task)
        {
-               /* split task into smaller ones, more than number of threads for uneven
-                * workloads where some parts of the image render slower than others */
+               /* split task into smaller ones */
                list<DeviceTask> tasks;
                task.split(tasks, TaskScheduler::num_threads());
 
index d13e86429d6f2bf3878f3891239accb837ef2510..93d57c65363a06b7227ed55a2e38456451bbcdb3 100644 (file)
@@ -786,7 +786,7 @@ void Session::update_status_time(bool show_pause, bool show_done)
                        substatus += string_printf(", Sample %d/%d", sample, num_samples);
                }
        }
-       else if(tile_manager.num_samples == INT_MAX)
+       else if(tile_manager.num_samples == USHRT_MAX)
                substatus = string_printf("Path Tracing Sample %d", sample+1);
        else
                substatus = string_printf("Path Tracing Sample %d/%d", sample+1, tile_manager.num_samples);
index abcb05561bdd6e7626f8f119daeaf91b2fa3715e..07960805f7748b6f2f2f15b22726eeff228a1a03 100644 (file)
@@ -186,12 +186,12 @@ void TaskScheduler::init(int num_threads)
                do_exit = false;
 
                if(num_threads == 0) {
-                       /* automatic number of threads will be main thread + num cores */
+                       /* automatic number of threads */
                        num_threads = system_cpu_thread_count();
                }
                else {
-                       /* main thread will also work, for fixed threads we count it too */
-                       num_threads -= 1;
+                       /* manual number of threads */
+                       num_threads;
                }
 
                /* launch threads that will be waiting for work */
index 5bca3f255af984b07b86eb4662e6feee334ca6ca..6e002ddd5b1335a7ed30186b2b1a154a92734f32 100644 (file)
@@ -94,8 +94,8 @@ public:
        static void init(int num_threads = 0);
        static void exit();
 
-       /* number of threads that can work on tasks, main thread counts too */
-       static int num_threads() { return threads.size() + 1; }
+       /* number of threads that can work on task */
+       static int num_threads() { return threads.size(); }
 
        /* test if any session is using the scheduler */
        static bool active() { return users != 0; }
index df50012244908407696c65f05ff41e77bcd8eb96..639fd50375931a4612331980c33b1eea3035f0a0 100644 (file)
@@ -191,7 +191,7 @@ void GHOST_DropTargetX11::UrlDecode(char *decodedOut, int bufferSize, const char
 
 char *GHOST_DropTargetX11::FileUrlDecode(char *fileUrl)
 {
-       if (!strncpy(fileUrl, "file://", 7) == 0) {
+       if (strncpy(fileUrl, "file://", 7) != 0) {
                /* assume one character of encoded URL can be expanded to 4 chars max */
                int decodedSize = 4 * strlen(fileUrl) + 1;
                char *decodedPath = (char *)malloc(decodedSize);
index f7e035e890d38fa7279fe37afcfb6cb3b7cf23aa..6e72e26beb4254ab4c736dd3c86cc95745fca7f6 100644 (file)
@@ -858,7 +858,8 @@ OSStatus GHOST_SystemCarbon::handleMouseEvent(EventRef event)
                        break;
                        
                case kEventMouseMoved:
-               case kEventMouseDragged: {
+               case kEventMouseDragged:
+               {
                        Point mousePos;
 
                        if (window) {
index d00265fbd9b2c3688d3f975e5a3a948bacf90114..2e39ee812cad1bad4723942a05788bf5c1461a3d 100644 (file)
@@ -1139,7 +1139,8 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                        break;
                }
                
-               default: {
+               default:
+               {
 #ifdef WITH_X11_XINPUT
                        if (xe->type == m_xtablet.MotionEvent) {
                                XDeviceMotionEvent *data = (XDeviceMotionEvent *)xe;
@@ -1505,7 +1506,7 @@ convertXKey(KeySym key)
 #define XCLIB_XCOUT_FALLBACK_TEXT   6
 
 /* Retrieves the contents of a selections. */
-void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
+void GHOST_SystemX11::getClipboard_xcout(const XEvent *evt,
                Atom sel, Atom target, unsigned char **txt,
                unsigned long *len, unsigned int *context) const
 {
@@ -1535,18 +1536,18 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
                        return;
 
                case XCLIB_XCOUT_SENTCONVSEL:
-                       if (evt.type != SelectionNotify)
+                       if (evt->type != SelectionNotify)
                                return;
 
-                       if (target == m_atom.UTF8_STRING && evt.xselection.property == None) {
+                       if (target == m_atom.UTF8_STRING && evt->xselection.property == None) {
                                *context = XCLIB_XCOUT_FALLBACK_UTF8;
                                return;
                        }
-                       else if (target == m_atom.COMPOUND_TEXT && evt.xselection.property == None) {
+                       else if (target == m_atom.COMPOUND_TEXT && evt->xselection.property == None) {
                                *context = XCLIB_XCOUT_FALLBACK_COMP;
                                return;
                        }
-                       else if (target == m_atom.TEXT && evt.xselection.property == None) {
+                       else if (target == m_atom.TEXT && evt->xselection.property == None) {
                                *context = XCLIB_XCOUT_FALLBACK_TEXT;
                                return;
                        }
@@ -1604,11 +1605,11 @@ void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
                         * then read it, delete it, etc. */
 
                        /* make sure that the event is relevant */
-                       if (evt.type != PropertyNotify)
+                       if (evt->type != PropertyNotify)
                                return;
 
                        /* skip unless the property has a new value */
-                       if (evt.xproperty.state != PropertyNewValue)
+                       if (evt->xproperty.state != PropertyNewValue)
                                return;
 
                        /* check size and format of the property */
@@ -1713,7 +1714,7 @@ GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
                        XNextEvent(m_display, &evt);
 
                /* fetch the selection, or part of it */
-               getClipboard_xcout(evt, sseln, target, &sel_buf, &sel_len, &context);
+               getClipboard_xcout(&evt, sseln, target, &sel_buf, &sel_len, &context);
 
                /* fallback is needed. set XA_STRING to target and restart the loop. */
                if (context == XCLIB_XCOUT_FALLBACK) {
index 6a492f64b4157fc9eaa2abde88abaeecf164b5fe..1f95e4b1ce2f69fd626c20765dbdd5cebd3e6589 100644 (file)
@@ -238,7 +238,7 @@ public:
 #endif
 
        /* Helped function for get data from the clipboard. */
-       void getClipboard_xcout(XEvent evt, Atom sel, Atom target,
+       void getClipboard_xcout(const XEvent *evt, Atom sel, Atom target,
                                unsigned char **txt, unsigned long *len,
                                unsigned int *context) const;
 
index 472136b813083fc8e3bec9b5da74c26ce73bc181..de2ae79d0b681f8bd83a4734c8e2c95b53011154 100644 (file)
@@ -1032,7 +1032,8 @@ GHOST_TSuccess GHOST_WindowCocoa::setState(GHOST_TWindowState state)
                        [m_window zoom:nil];
                        break;
                
-               case GHOST_kWindowStateFullScreen: {
+               case GHOST_kWindowStateFullScreen:
+               {
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
                        NSUInteger masks = [m_window styleMask];
 
index 1f090edd309b1334fbb3cbc71ba98073c32993c1..ca0d6bbaea1e1c7c6817a3d0ff782b0ee41651c0 100644 (file)
@@ -5,6 +5,7 @@ Blender Main I18n font ("droidsans.ttf") includes glyphs imported from the follo
 3. Samyak-devanagari
 4. Droid Sans Hebrew Regular
 5. Droid Sans Ethiopic Regular
+6. Samyak-tamil
 
 These were merged using FontForge in (approximately) the above order. For each glyph,
 a license of the font from which it was imported is applied.
@@ -30,7 +31,7 @@ Copyright:
 License: Apache-2.0
  See Appendix A.
 
-(3) Samyak-devanagari
+(3) Samyak-devanagari and (6) Samyak-tamil
 Copyright: 2005-2006, Rahul Bhalerao <b.rahul.pm@gmail.com>
            2005-2006, Bageshri Salvi <sbageshri@gmail.com>
            2005-2006, Pravin Satpute <pravin.d.s@gmail.com>
index a0e7502cc1fc30704a48f395516a81b072eb209a..81683e6379fbb581b0810f0ee56d37d016049c49 100644 (file)
Binary files a/release/datafiles/fonts/droidsans.ttf.gz and b/release/datafiles/fonts/droidsans.ttf.gz differ
index 01d903c457be96f487850b4d298b5b15ae53d824..3c05ba86cd32bbf6665678ecacb8e6e55c39952c 100644 (file)
Binary files a/release/datafiles/splash.png and b/release/datafiles/splash.png differ
diff --git a/release/scripts/presets/cycles/sampling/final.py b/release/scripts/presets/cycles/sampling/final.py
new file mode 100644 (file)
index 0000000..4bb90d1
--- /dev/null
@@ -0,0 +1,16 @@
+import bpy
+cycles = bpy.context.scene.cycles
+
+cycles.squared_samples = True
+
+cycles.samples = 24
+cycles.preview_samples = 24
+cycles.aa_samples = 8
+cycles.preview_aa_samples = 8
+
+cycles.diffuse_samples = 3
+cycles.glossy_samples = 2
+cycles.transmission_samples = 2
+cycles.ao_samples = 1
+cycles.mesh_light_samples = 2
+cycles.subsurface_samples = 2
diff --git a/release/scripts/presets/cycles/sampling/preview.py b/release/scripts/presets/cycles/sampling/preview.py
new file mode 100644 (file)
index 0000000..fbe8a01
--- /dev/null
@@ -0,0 +1,16 @@
+import bpy
+cycles = bpy.context.scene.cycles
+
+cycles.squared_samples = True
+
+cycles.samples = 12
+cycles.preview_samples = 12
+cycles.aa_samples = 4
+cycles.preview_aa_samples = 4
+
+cycles.diffuse_samples = 3
+cycles.glossy_samples = 2
+cycles.transmission_samples = 2
+cycles.ao_samples = 1
+cycles.mesh_light_samples = 2
+cycles.subsurface_samples = 2
index 1a62030efb12afd796935310ddb05f01c963eb6f..1d90535b46f9c80789a11904cc76f69205062696 100644 (file)
@@ -364,7 +364,7 @@ class DATA_PT_paragraph(CurveButtonsPanel, Panel):
 
         col = split.column(align=True)
         col.label(text="Spacing:")
-        col.prop(text, "space_character", text="Character")
+        col.prop(text, "space_character", text="Letter")
         col.prop(text, "space_word", text="Word")
         col.prop(text, "space_line", text="Line")
 
index c9b1bc0ccff4cd23d7fd70f1716acb4a374e5d30..d38f5f934b41d6bc2fe6a19ae78bc04d61bb0ce2 100644 (file)
@@ -339,6 +339,11 @@ class MASK_MT_select(Menu):
 
         layout.separator()
 
+        layout.operator("mask.select_more")
+        layout.operator("mask.select_less")
+
+        layout.separator()
+
         layout.operator("mask.select_all").action = 'TOGGLE'
         layout.operator("mask.select_all", text="Inverse").action = 'INVERT'
 
index 7fe8d334572c1aa71cd17736ce4150778a980eab..19095df6a14147e4e1e416d338c7ff50adbd4d43 100644 (file)
@@ -293,7 +293,10 @@ class VIEW3D_MT_snap(Menu):
         layout = self.layout
 
         layout.operator("view3d.snap_selected_to_grid", text="Selection to Grid")
-        layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor")
+        props = layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor")
+        props.use_offset = False
+        props = layout.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor (Offset)")
+        props.use_offset = True
 
         layout.separator()
 
@@ -723,6 +726,7 @@ class VIEW3D_MT_select_edit_lattice(Menu):
 
         layout.separator()
 
+        layout.operator("lattice.select_random")
         layout.operator("lattice.select_all").action = 'TOGGLE'
         layout.operator("lattice.select_all", text="Inverse").action = 'INVERT'
 
@@ -747,6 +751,11 @@ class VIEW3D_MT_select_edit_armature(Menu):
 
         layout.separator()
 
+        layout.operator("armature.select_more", text="More")
+        layout.operator("armature.select_less", text="Less")
+
+        layout.separator()
+
         layout.operator("armature.select_hierarchy", text="Parent").direction = 'PARENT'
         layout.operator("armature.select_hierarchy", text="Child").direction = 'CHILD'
 
@@ -2534,7 +2543,7 @@ class VIEW3D_PT_view3d_display(Panel):
         view = context.space_data
         scene = context.scene
         gs = scene.game_settings
-        ob = context.object
+        obj = context.object
 
         col = layout.column()
         col.prop(view, "show_only_render")
@@ -2574,6 +2583,8 @@ class VIEW3D_PT_view3d_display(Panel):
             if view.use_matcap:
                 col.template_icon_view(view, "matcap_icon")
         col.prop(view, "show_backface_culling")
+        if obj and obj.mode == 'EDIT' and view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'}:
+            col.prop(view, "show_occlude_wire")
 
         layout.separator()
 
index ae936a1659a6d98f77313b78014c378f9684f2c3..40fc71e82ca8f360791f6814e9adc8dfa4e9ceb1 100644 (file)
@@ -438,7 +438,7 @@ struct DerivedMesh {
         */
        void (*drawMappedFacesMat)(DerivedMesh *dm,
                                   void (*setMaterial)(void *userData, int, void *attribs),
-                                  int (*setFace)(void *userData, int index), void *userData);
+                                  bool (*setFace)(void *userData, int index), void *userData);
 
        /** Release reference to the DerivedMesh. This function decides internally
         * if the DerivedMesh will be freed, or cached for later use. */
index 9e874c9aa151f1e2137341d14f8f3fa7295533b0..8c556e00aaaf01cdf8f2c6555d89be6e353cb96a 100644 (file)
@@ -41,8 +41,8 @@ extern "C" {
 /* these lines are grep'd, watch out for our not-so-awesome regex
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
-#define BLENDER_VERSION         267
-#define BLENDER_SUBVERSION      1
+#define BLENDER_VERSION         268
+#define BLENDER_SUBVERSION      0
 
 /* 262 was the last editmesh release but it has compatibility code for bmesh data */
 #define BLENDER_MINVERSION      262
@@ -50,9 +50,9 @@ extern "C" {
 
 /* used by packaging tools */
 /* can be left blank, otherwise a,b,c... etc with no quotes */
-#define BLENDER_VERSION_CHAR    b
+#define BLENDER_VERSION_CHAR   
 /* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE   rc
+#define BLENDER_VERSION_CYCLE   alpha
 
 extern char versionstr[]; /* from blender.c */
 
index a159cbb13d4098eb6621d164f7da625c636f4276..de60d316426936b5aaa0f314cd84728588398f72 100644 (file)
@@ -59,6 +59,8 @@ void key_curve_position_weights(float t, float data[4], int type);
 void key_curve_tangent_weights(float t, float data[4], int type);
 void key_curve_normal_weights(float t, float data[4], int type);
 
+float *BKE_key_evaluate_object_ex(struct Scene *scene, struct Object *ob, int *r_totelem,
+                                  float *arr, size_t arr_size);
 float *BKE_key_evaluate_object(struct Scene *scene, struct Object *ob, int *r_totelem);
 
 struct Key      *BKE_key_from_object(struct Object *ob);
index 79261ad7de83438eef399c903a94c3d8a69266cc..b11f88d5260147d089a8b720161d368829644ada 100644 (file)
@@ -3107,7 +3107,7 @@ static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm)
                }
        }
        else {
-               printf("%s: Error during creation polygon infos\n", __func__);
+               printf("Navmesh: Unable to generate valid Navmesh");
        }
 
        /* clean up */
index fa85f6e4f86e8d214992df23b5a57b5990c9a00f..70fbf2d39e8584ce7fb8beabe7d58b6353b747f8 100644 (file)
@@ -930,9 +930,8 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
                                                if (fmd->flag & FCM_LIMIT_XMAX) {
                                                        max = max_ff(max, fmd->rect.xmax);
                                                }
+                                               break;
                                        }
-                                       break;
-                                               
                                        case FMODIFIER_TYPE_CYCLES: /* Cycles F-Modifier */
                                        {
                                                FMod_Cycles *fmd = (FMod_Cycles *)fcm->data;
@@ -941,9 +940,8 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
                                                        min = MINAFRAMEF;
                                                if (fmd->after_mode != FCM_EXTRAPOLATE_NONE)
                                                        max = MAXFRAMEF;
+                                               break;
                                        }
-                                       break;
-                                               
                                        /* TODO: function modifier may need some special limits */
                                                
                                        default: /* all other standard modifiers are on the infinite range... */
index 1eb8f4f8b7a1906e67332aa980b538c715e1ddd9..c4b37b1d9bde5b75bab4710f67ffa942be31b4fa 100644 (file)
@@ -2092,8 +2092,8 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
                                /* z-axis scale */
                                scale = len_v3(pchan->pose_mat[2]);
                                mul_v3_fl(poseMat[2], scale);
+                               break;
                        }
-                       break;
                        case CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC:
                        {
                                /* 'volume preservation' */
@@ -2115,8 +2115,8 @@ static void splineik_evaluate_bone(tSplineIK_Tree *tree, Scene *scene, Object *o
                                /* apply the scaling */
                                mul_v3_fl(poseMat[0], scale);
                                mul_v3_fl(poseMat[2], scale);
+                               break;
                        }
-                       break;
                }
 
                /* finally, multiply the x and z scaling by the radius of the curve too,
index 711ea791cbb0bd68244ac6abff1ef34c6c5b5ba6..d692e8e0cf77e74e32427bfb03cdcf0bb7b8e5ca 100644 (file)
@@ -1424,7 +1424,7 @@ static void cdDM_drawFacesGLSL(DerivedMesh *dm, DMSetMaterial setMaterial)
 
 static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
                                     void (*setMaterial)(void *userData, int, void *attribs),
-                                    int (*setFace)(void *userData, int index), void *userData)
+                                    bool (*setFace)(void *userData, int index), void *userData)
 {
        CDDerivedMesh *cddm = (CDDerivedMesh *) dm;
        GPUVertexAttribs gattribs;
index 9323531e5fe0ea6194a75bfef2c39994caf31909..7e878e86c1e00ebc8bbbf334704f274c3b350d51 100644 (file)
@@ -328,8 +328,8 @@ void curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope)
                                cuma->curve[i].x = i / ((float)cuma->totpoint - 1);
                                cuma->curve[i].y = 0.5;
                        }
+                       break;
                }
-               break;
                case CURVE_PRESET_ROUND:
                        cuma->curve[0].x = 0;
                        cuma->curve[0].y = 1;
index 23fd498303dfddfb70e92aa8831a9634b7760756..8926ef0b599ff42d46bf3fc64be1c08f143f5038 100644 (file)
@@ -133,8 +133,8 @@ bConstraintOb *BKE_constraints_make_evalob(Scene *scene, Object *ob, void *subda
                                unit_m4(cob->matrix);
                        
                        copy_m4_m4(cob->startmat, cob->matrix);
+                       break;
                }
-               break;
                case CONSTRAINT_OBTYPE_BONE:
                {
                        /* only set if we have valid bone, otherwise default */
@@ -159,9 +159,8 @@ bConstraintOb *BKE_constraints_make_evalob(Scene *scene, Object *ob, void *subda
                                unit_m4(cob->matrix);
                                
                        copy_m4_m4(cob->startmat, cob->matrix);
+                       break;
                }
-               break;
-                       
                default: /* other types not yet handled */
                        unit_m4(cob->matrix);
                        unit_m4(cob->startmat);
@@ -196,8 +195,8 @@ void BKE_constraints_clear_evalob(bConstraintOb *cob)
                                /* copy inverse of delta back to owner */
                                invert_m4_m4(cob->ob->constinv, delta);
                        }
+                       break;
                }
-               break;
                case CONSTRAINT_OBTYPE_BONE:
                {
                        /* cob->ob or cob->pchan might not exist */
@@ -208,8 +207,8 @@ void BKE_constraints_clear_evalob(bConstraintOb *cob)
                                /* copy inverse of delta back to owner */
                                invert_m4_m4(cob->pchan->constinv, delta);
                        }
+                       break;
                }
-               break;
        }
        
        /* free tempolary struct */
@@ -247,8 +246,8 @@ void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[
                                        /* call self with slightly different values */
                                        BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to);
                                }
+                               break;
                        }
-                       break;
                        case CONSTRAINT_SPACE_POSE: /* ---------- FROM POSESPACE ---------- */
                        {
                                /* pose to world */
@@ -268,8 +267,8 @@ void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[
                                                mul_m4_m4m4(mat, imat, mat);
                                        }
                                }
+                               break;
                        }
-                       break;
                        case CONSTRAINT_SPACE_LOCAL: /* ------------ FROM LOCALSPACE --------- */
                        {
                                /* local to pose - do inverse procedure that was done for pose to local */
@@ -283,8 +282,8 @@ void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[
                                        /* call self with slightly different values */
                                        BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to);
                                }
+                               break;
                        }
-                       break;
                        case CONSTRAINT_SPACE_PARLOCAL: /* -------------- FROM LOCAL WITH PARENT ---------- */
                        {
                                /* local + parent to pose */
@@ -298,8 +297,8 @@ void BKE_constraint_mat_convertspace(Object *ob, bPoseChannel *pchan, float mat[
                                        /* call self with slightly different values */
                                        BKE_constraint_mat_convertspace(ob, pchan, mat, CONSTRAINT_SPACE_POSE, to);
                                }
+                               break;
                        }
-                       break;
                }
        }
        else {
@@ -2234,8 +2233,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                        
                                                /* the z axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
+                                               break;
                                        }
-                                       break;
                                        case TRACK_Z: /* LOCK X TRACK Z */
                                        {
                                                /* Projection of Vector on the plane */
@@ -2248,8 +2247,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                        
                                                /* the z axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
+                                               break;
                                        }
-                                       break;
                                        case TRACK_nY: /* LOCK X TRACK -Y */
                                        {
                                                /* Projection of Vector on the plane */
@@ -2263,8 +2262,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                        
                                                /* the z axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
+                                               break;
                                        }
-                                       break;
                                        case TRACK_nZ: /* LOCK X TRACK -Z */
                                        {
                                                /* Projection of Vector on the plane */
@@ -2278,16 +2277,16 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                                
                                                /* the z axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
+                                               break;
                                        }
-                                       break;
                                        default:
                                        {
                                                unit_m3(totmat);
+                                               break;
                                        }
-                                       break;
                                }
+                               break;
                        }
-                       break;
                        case LOCK_Y: /* LOCK Y */
                        {
                                switch (data->trackflag) {
@@ -2303,8 +2302,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
 
                                                /* the z axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
+                                               break;
                                        }
-                                       break;
                                        case TRACK_Z: /* LOCK Y TRACK Z */
                                        {
                                                /* Projection of Vector on the plane */
@@ -2317,8 +2316,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                        
                                                /* the z axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
+                                               break;
                                        }
-                                       break;
                                        case TRACK_nX: /* LOCK Y TRACK -X */
                                        {
                                                /* Projection of Vector on the plane */
@@ -2332,8 +2331,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                        
                                                /* the z axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[2], totmat[0], totmat[1]);
+                                               break;
                                        }
-                                       break;
                                        case TRACK_nZ: /* LOCK Y TRACK -Z */
                                        {
                                                /* Projection of Vector on the plane */
@@ -2347,16 +2346,16 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                        
                                                /* the z axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
+                                               break;
                                        }
-                                       break;
                                        default:
                                        {
                                                unit_m3(totmat);
+                                               break;
                                        }
-                                       break;
                                }
+                               break;
                        }
-                       break;
                        case LOCK_Z: /* LOCK Z */
                        {
                                switch (data->trackflag) {
@@ -2372,8 +2371,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                        
                                                /* the x axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
+                                               break;
                                        }
-                                       break;
                                        case TRACK_Y: /* LOCK Z TRACK Y */
                                        {
                                                /* Projection of Vector on the plane */
@@ -2386,8 +2385,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                                
                                                /* the x axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
+                                               break;
                                        }
-                                       break;
                                        case TRACK_nX: /* LOCK Z TRACK -X */
                                        {
                                                /* Projection of Vector on the plane */
@@ -2401,8 +2400,8 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                        
                                                /* the x axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[1], totmat[2], totmat[0]);
+                                               break;
                                        }
-                                       break;
                                        case TRACK_nY: /* LOCK Z TRACK -Y */
                                        {
                                                /* Projection of Vector on the plane */
@@ -2416,21 +2415,21 @@ static void locktrack_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
                                                
                                                /* the x axis gets mapped onto a third orthogonal vector */
                                                cross_v3_v3v3(totmat[0], totmat[1], totmat[2]);
+                                               break;
                                        }
-                                       break;
                                        default:
                                        {
                                                unit_m3(totmat);
+                                               break;
                                        }
-                                       break;
                                }
+                               break;
                        }
-                       break;
                        default:
                        {
                                unit_m3(totmat);
+                               break;
                        }
-                       break;
                }
                /* Block to keep matrix heading */
                copy_m3_m4(tmpmat, cob->matrix);
@@ -4408,8 +4407,8 @@ static bConstraint *add_new_constraint(Object *ob, bPoseChannel *pchan, const ch
                                con->ownspace = CONSTRAINT_SPACE_POSE;
                                con->flag |= CONSTRAINT_SPACEONCE;
                        }
+                       break;
                }
-               break;
        }
        
        return con;
@@ -4634,8 +4633,8 @@ void BKE_get_constraint_target_matrix(Scene *scene, bConstraint *con, int index,
                                        unit_m4(cob->matrix);
                                        unit_m4(cob->startmat);
                                }
+                               break;
                        }
-                       break;
                        case CONSTRAINT_OBTYPE_BONE: /* this may occur in some cases */
                        {
                                cob->ob = NULL; /* this might not work at all :/ */
@@ -4648,8 +4647,8 @@ void BKE_get_constraint_target_matrix(Scene *scene, bConstraint *con, int index,
                                        unit_m4(cob->matrix);
                                        unit_m4(cob->startmat);
                                }
+                               break;
                        }
-                       break;
                }
                
                /* get targets - we only need the first one though (and there should only be one) */
index e08474e22c992b129547fc6ebcf918b0d0c4b464..28fa5cc689b867e6ae2c9e414175dccffdab7ae2 100644 (file)
@@ -158,7 +158,7 @@ static void layerCopy_mdeformvert(const void *source, void *dest,
                MDeformVert *dvert = (MDeformVert *)((char *)dest + i * size);
 
                if (dvert->totweight) {
-                       MDeformWeight *dw = MEM_callocN(dvert->totweight * sizeof(*dw),
+                       MDeformWeight *dw = MEM_mallocN(dvert->totweight * sizeof(*dw),
                                                        "layerCopy_mdeformvert dw");
 
                        memcpy(dw, dvert->dw, dvert->totweight * sizeof(*dw));
@@ -265,7 +265,7 @@ static void layerInterp_mdeformvert(void **sources, const float *weights,
        if (dvert->dw) MEM_freeN(dvert->dw);
 
        if (totweight) {
-               dvert->dw = MEM_callocN(sizeof(*dvert->dw) * totweight,
+               dvert->dw = MEM_mallocN(sizeof(*dvert->dw) * totweight,
                                        "layerInterp_mdeformvert dvert->dw");
                dvert->totweight = totweight;
 
index a492b227815c630297a1f1ca79eb4c98331f1c5f..0dd9d8550bb75af1e924cb3ccbfd03d1a2ed83d4 100644 (file)
@@ -735,7 +735,7 @@ MDeformWeight *defvert_verify_index(MDeformVert *dvert, const int defgroup)
        if (dw_new)
                return dw_new;
 
-       dw_new = MEM_callocN(sizeof(MDeformWeight) * (dvert->totweight + 1), "deformWeight");
+       dw_new = MEM_mallocN(sizeof(MDeformWeight) * (dvert->totweight + 1), "deformWeight");
        if (dvert->dw) {
                memcpy(dw_new, dvert->dw, sizeof(MDeformWeight) * dvert->totweight);
                MEM_freeN(dvert->dw);
index 46cee96a53716d0f61656ba2248a335432524c5b..ddd5e4a1e02ebaea472c371126d91f084bebd9b8 100644 (file)
@@ -920,7 +920,7 @@ static void emdm_pass_attrib_vertex_mat(DMVertexAttribs *attribs, BMLoop *loop,
 
 static void emDM_drawMappedFacesMat(DerivedMesh *dm,
                                     void (*setMaterial)(void *userData, int, void *attribs),
-                                    int (*setFace)(void *userData, int index), void *userData)
+                                    bool (*setFace)(void *userData, int index), void *userData)
 {
        EditDerivedBMesh *bmdm = (EditDerivedBMesh *)dm;
        BMEditMesh *em = bmdm->em;
index bd282095c333943a10d8634c2f88dbd82361b0cb..55a312f31ba9a384e61ec3f4a2e5e71871dee515 100644 (file)
@@ -667,17 +667,16 @@ short fcurve_are_keyframes_usable(FCurve *fcu)
                                        
                                        if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0)
                                                return 0;
+                                       break;
                                }
-                               break;
                                case FMODIFIER_TYPE_FN_GENERATOR:
                                {
                                        FMod_FunctionGenerator *data = (FMod_FunctionGenerator *)fcm->data;
                                        
                                        if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0)
                                                return 0;
+                                       break;
                                }
-                               break;
-                                       
                                /* always harmful - cannot allow */
                                default:
                                        return 0;
@@ -1703,9 +1702,8 @@ static float evaluate_driver(ChannelDriver *driver, const float evaltime)
                                else
                                        driver->curval = value;
                        }
+                       break;
                }
-               break;
-                       
                case DRIVER_TYPE_MIN: /* smallest value */
                case DRIVER_TYPE_MAX: /* largest value */
                {
@@ -1738,9 +1736,8 @@ static float evaluate_driver(ChannelDriver *driver, const float evaltime)
                        
                        /* store value in driver */
                        driver->curval = value;
+                       break;
                }
-               break;
-                       
                case DRIVER_TYPE_PYTHON: /* expression */
                {
 #ifdef WITH_PYTHON
@@ -1759,9 +1756,8 @@ static float evaluate_driver(ChannelDriver *driver, const float evaltime)
 #else /* WITH_PYTHON*/
                        (void)evaltime;
 #endif /* WITH_PYTHON*/
+                       break;
                }
-               break;
-               
                default:
                {
                        /* special 'hack' - just use stored value 
index 19912a19d943cbe5ef91d4a340a4cc60c903d1ce..234f8667632b1db20875c0376d79985a91d0333d 100644 (file)
@@ -213,9 +213,8 @@ static void fcm_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float *c
                        /* cleanup */
                        if (powers) 
                                MEM_freeN(powers);
+                       break;
                }
-               break;
-                       
                case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* Factorized polynomial */
                {
                        float value = 1.0f, *cp = NULL;
@@ -232,8 +231,8 @@ static void fcm_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float *c
                                else
                                        *cvalue = value;
                        }
+                       break;
                }
-               break;
        }
 }
 
@@ -316,8 +315,8 @@ static void fcm_fn_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float
                        }
                        else
                                fn = tan;
+                       break;
                }
-               break;
                case FCM_GENERATOR_FN_LN: /* natural log */
                {
                        /* check that value is greater than 1? */
@@ -328,8 +327,8 @@ static void fcm_fn_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float
                                if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0)
                                        *cvalue = 0.0f;  /* no value possible here */
                        }
+                       break;
                }
-               break;
                case FCM_GENERATOR_FN_SQRT: /* square root */
                {
                        /* no negative numbers */
@@ -340,9 +339,8 @@ static void fcm_fn_generator_evaluate(FCurve *UNUSED(fcu), FModifier *fcm, float
                                if ((data->flag & FCM_GENERATOR_ADDITIVE) == 0)
                                        *cvalue = 0.0f;  /* no value possible here */
                        }
+                       break;
                }
-               break;
-               
                default:
                        printf("Invalid Function-Generator for F-Modifier - %d\n", data->type);
        }
index b9064fe8ba31f6350e18d684c2d16e4a568fc697..c8e18bc3dee47d37860ca9902523f86a3a02ab8d 100644 (file)
 #include "BKE_global.h"
 
 
+#ifdef __GNUC__
+#  pragma GCC diagnostic ignored "-Wtype-limits"
+#endif
+
 #ifdef _OPENMP
 #  define CLOTH_OPENMP_LIMIT 512
 #endif
index 10226ade786c12d7e82cf52836d115721e2d56f5..ecc4a03d2551e8c436ce4239e6a8baf7d21aa1f7 100644 (file)
@@ -1174,9 +1174,8 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
                {
                        /* just copy, as the new defines match the old ones... */
                        fcu->extend = icu->extrap;
+                       break;
                }
-               break;
-                       
                case IPO_CYCL: /* cyclic extrapolation */
                case IPO_CYCLX: /* cyclic extrapolation + offset */
                {
@@ -1191,8 +1190,8 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i
                                data->before_mode = data->after_mode = FCM_EXTRAPOLATE_CYCLIC_OFFSET;
                        else
                                data->before_mode = data->after_mode = FCM_EXTRAPOLATE_CYCLIC;
+                       break;
                }
-               break;
        }
        
        /* -------- */
index e141b9dbabe83cded1dbad094f179f9358a1e6c6..a79fa3873f517dfbf0db92dfe62932e57e7b8c8b 100644 (file)
@@ -1342,7 +1342,8 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
 }
 
 /* returns key coordinates (+ tilt) when key applied, NULL otherwise */
-float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem)
+float *BKE_key_evaluate_object_ex(Scene *scene, Object *ob, int *r_totelem,
+                                  float *arr, size_t arr_size)
 {
        Key *key = BKE_key_from_object(ob);
        KeyBlock *actkb = BKE_keyblock_from_object(ob);
@@ -1386,7 +1387,16 @@ float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem)
                return NULL;
        
        /* allocate array */
-       out = MEM_callocN(size, "BKE_key_evaluate_object out");
+       if (arr == NULL) {
+               out = MEM_callocN(size, "BKE_key_evaluate_object out");
+       }
+       else {
+               if (arr_size != size) {
+                       return NULL;
+               }
+
+               out = (char *)arr;
+       }
 
        /* prevent python from screwing this up? anyhoo, the from pointer could be dropped */
        key->from = (ID *)ob->data;
@@ -1427,6 +1437,11 @@ float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem)
        return (float *)out;
 }
 
+float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem)
+{
+       return BKE_key_evaluate_object_ex(scene, ob, r_totelem, NULL, 0);
+}
+
 Key *BKE_key_from_object(Object *ob)
 {
        if (ob == NULL) return NULL;
index 3ab1a8093bee6333a6f9bbb9288a768cf4675fa5..497554be11347ed6c667942bafcda6ee18e6ae09 100644 (file)
@@ -201,20 +201,20 @@ static LineStyleModifier *alloc_color_modifier(int type)
        size_t size;
 
        switch (type) {
-       case LS_MODIFIER_ALONG_STROKE:
-               size = sizeof(LineStyleColorModifier_AlongStroke);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-               size = sizeof(LineStyleColorModifier_DistanceFromCamera);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-               size = sizeof(LineStyleColorModifier_DistanceFromObject);
-               break;
-       case LS_MODIFIER_MATERIAL:
-               size = sizeof(LineStyleColorModifier_Material);
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               case LS_MODIFIER_ALONG_STROKE:
+                       size = sizeof(LineStyleColorModifier_AlongStroke);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+                       size = sizeof(LineStyleColorModifier_DistanceFromCamera);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+                       size = sizeof(LineStyleColorModifier_DistanceFromObject);
+                       break;
+               case LS_MODIFIER_MATERIAL:
+                       size = sizeof(LineStyleColorModifier_Material);
+                       break;
+               default:
+                       return NULL; /* unknown modifier type */
        }
 
        return new_modifier(type, size);
@@ -228,26 +228,26 @@ LineStyleModifier *BKE_add_linestyle_color_modifier(FreestyleLineStyle *linestyl
        m->blend = MA_RAMP_BLEND;
 
        switch (type) {
-       case LS_MODIFIER_ALONG_STROKE:
-               ((LineStyleColorModifier_AlongStroke *)m)->color_ramp = add_colorband(1);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-               ((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp = add_colorband(1);
-               ((LineStyleColorModifier_DistanceFromCamera *)m)->range_min = 0.0f;
-               ((LineStyleColorModifier_DistanceFromCamera *)m)->range_max = 10000.0f;
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-               ((LineStyleColorModifier_DistanceFromObject *)m)->target = NULL;
-               ((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp = add_colorband(1);
-               ((LineStyleColorModifier_DistanceFromObject *)m)->range_min = 0.0f;
-               ((LineStyleColorModifier_DistanceFromObject *)m)->range_max = 10000.0f;
-               break;
-       case LS_MODIFIER_MATERIAL:
-               ((LineStyleColorModifier_Material *)m)->color_ramp = add_colorband(1);
-               ((LineStyleColorModifier_Material *)m)->mat_attr = LS_MODIFIER_MATERIAL_DIFF;
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               case LS_MODIFIER_ALONG_STROKE:
+                       ((LineStyleColorModifier_AlongStroke *)m)->color_ramp = add_colorband(1);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+                       ((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp = add_colorband(1);
+                       ((LineStyleColorModifier_DistanceFromCamera *)m)->range_min = 0.0f;
+                       ((LineStyleColorModifier_DistanceFromCamera *)m)->range_max = 10000.0f;
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+                       ((LineStyleColorModifier_DistanceFromObject *)m)->target = NULL;
+                       ((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp = add_colorband(1);
+                       ((LineStyleColorModifier_DistanceFromObject *)m)->range_min = 0.0f;
+                       ((LineStyleColorModifier_DistanceFromObject *)m)->range_max = 10000.0f;
+                       break;
+               case LS_MODIFIER_MATERIAL:
+                       ((LineStyleColorModifier_Material *)m)->color_ramp = add_colorband(1);
+                       ((LineStyleColorModifier_Material *)m)->mat_attr = LS_MODIFIER_MATERIAL_DIFF;
+                       break;
+               default:
+                       return NULL; /* unknown modifier type */
        }
        add_to_modifier_list(&linestyle->color_modifiers, m);
 
@@ -264,23 +264,23 @@ LineStyleModifier *BKE_copy_linestyle_color_modifier(FreestyleLineStyle *linesty
        new_m->blend = m->blend;
 
        switch (m->type) {
-       case LS_MODIFIER_ALONG_STROKE:
+               case LS_MODIFIER_ALONG_STROKE:
                {
                        LineStyleColorModifier_AlongStroke *p = (LineStyleColorModifier_AlongStroke *)m;
                        LineStyleColorModifier_AlongStroke *q = (LineStyleColorModifier_AlongStroke *)new_m;
                        q->color_ramp = MEM_dupallocN(p->color_ramp);
+                       break;
                }
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
                {
                        LineStyleColorModifier_DistanceFromCamera *p = (LineStyleColorModifier_DistanceFromCamera *)m;
                        LineStyleColorModifier_DistanceFromCamera *q = (LineStyleColorModifier_DistanceFromCamera *)new_m;
                        q->color_ramp = MEM_dupallocN(p->color_ramp);
                        q->range_min = p->range_min;
                        q->range_max = p->range_max;
+                       break;
                }
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
                {
                        LineStyleColorModifier_DistanceFromObject *p = (LineStyleColorModifier_DistanceFromObject *)m;
                        LineStyleColorModifier_DistanceFromObject *q = (LineStyleColorModifier_DistanceFromObject *)new_m;
@@ -290,19 +290,19 @@ LineStyleModifier *BKE_copy_linestyle_color_modifier(FreestyleLineStyle *linesty
                        q->color_ramp = MEM_dupallocN(p->color_ramp);
                        q->range_min = p->range_min;
                        q->range_max = p->range_max;
+                       break;
                }
-               break;
-       case LS_MODIFIER_MATERIAL:
+               case LS_MODIFIER_MATERIAL:
                {
                        LineStyleColorModifier_Material *p = (LineStyleColorModifier_Material *)m;
                        LineStyleColorModifier_Material *q = (LineStyleColorModifier_Material *)new_m;
                        q->color_ramp = MEM_dupallocN(p->color_ramp);
                        q->flags = p->flags;
                        q->mat_attr = p->mat_attr;
+                       break;
                }
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               default:
+                       return NULL; /* unknown modifier type */
        }
        add_to_modifier_list(&linestyle->color_modifiers, new_m);
 
@@ -312,18 +312,18 @@ LineStyleModifier *BKE_copy_linestyle_color_modifier(FreestyleLineStyle *linesty
 void BKE_remove_linestyle_color_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
 {
        switch (m->type) {
-       case LS_MODIFIER_ALONG_STROKE:
-               MEM_freeN(((LineStyleColorModifier_AlongStroke *)m)->color_ramp);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-               MEM_freeN(((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-               MEM_freeN(((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp);
-               break;
-       case LS_MODIFIER_MATERIAL:
-               MEM_freeN(((LineStyleColorModifier_Material *)m)->color_ramp);
-               break;
+               case LS_MODIFIER_ALONG_STROKE:
+                       MEM_freeN(((LineStyleColorModifier_AlongStroke *)m)->color_ramp);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+                       MEM_freeN(((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+                       MEM_freeN(((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp);
+                       break;
+               case LS_MODIFIER_MATERIAL:
+                       MEM_freeN(((LineStyleColorModifier_Material *)m)->color_ramp);
+                       break;
        }
        BLI_freelinkN(&linestyle->color_modifiers, m);
 }
@@ -333,20 +333,20 @@ static LineStyleModifier *alloc_alpha_modifier(int type)
        size_t size;
 
        switch (type) {
-       case LS_MODIFIER_ALONG_STROKE:
-               size = sizeof(LineStyleAlphaModifier_AlongStroke);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-               size = sizeof(LineStyleAlphaModifier_DistanceFromCamera);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-               size = sizeof(LineStyleAlphaModifier_DistanceFromObject);
-               break;
-       case LS_MODIFIER_MATERIAL:
-               size = sizeof(LineStyleAlphaModifier_Material);
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               case LS_MODIFIER_ALONG_STROKE:
+                       size = sizeof(LineStyleAlphaModifier_AlongStroke);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+                       size = sizeof(LineStyleAlphaModifier_DistanceFromCamera);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+                       size = sizeof(LineStyleAlphaModifier_DistanceFromObject);
+                       break;
+               case LS_MODIFIER_MATERIAL:
+                       size = sizeof(LineStyleAlphaModifier_Material);
+                       break;
+               default:
+                       return NULL; /* unknown modifier type */
        }
        return new_modifier(type, size);
 }
@@ -359,38 +359,38 @@ LineStyleModifier *BKE_add_linestyle_alpha_modifier(FreestyleLineStyle *linestyl
        m->blend = LS_VALUE_BLEND;
 
        switch (type) {
-       case LS_MODIFIER_ALONG_STROKE:
+               case LS_MODIFIER_ALONG_STROKE:
                {
                        LineStyleAlphaModifier_AlongStroke *p = (LineStyleAlphaModifier_AlongStroke *)m;
                        p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+                       break;
                }
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
                {
                        LineStyleAlphaModifier_DistanceFromCamera *p = (LineStyleAlphaModifier_DistanceFromCamera *)m;
                        p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
                        p->range_min = 0.0f;
                        p->range_max = 10000.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
                {
                        LineStyleAlphaModifier_DistanceFromObject *p = (LineStyleAlphaModifier_DistanceFromObject *)m;
                        p->target = NULL;
                        p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
                        p->range_min = 0.0f;
                        p->range_max = 10000.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_MATERIAL:
+               case LS_MODIFIER_MATERIAL:
                {
                        LineStyleAlphaModifier_Material *p = (LineStyleAlphaModifier_Material *)m;
                        p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
                        p->mat_attr = LS_MODIFIER_MATERIAL_DIFF;
+                       break;
                }
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               default:
+                       return NULL; /* unknown modifier type */
        }
        add_to_modifier_list(&linestyle->alpha_modifiers, m);
 
@@ -407,15 +407,15 @@ LineStyleModifier *BKE_copy_linestyle_alpha_modifier(FreestyleLineStyle *linesty
        new_m->blend = m->blend;
 
        switch (m->type) {
-       case LS_MODIFIER_ALONG_STROKE:
+               case LS_MODIFIER_ALONG_STROKE:
                {
                        LineStyleAlphaModifier_AlongStroke *p = (LineStyleAlphaModifier_AlongStroke *)m;
                        LineStyleAlphaModifier_AlongStroke *q = (LineStyleAlphaModifier_AlongStroke *)new_m;
                        q->curve = curvemapping_copy(p->curve);
                        q->flags = p->flags;
+                       break;
                }
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
                {
                        LineStyleAlphaModifier_DistanceFromCamera *p = (LineStyleAlphaModifier_DistanceFromCamera *)m;
                        LineStyleAlphaModifier_DistanceFromCamera *q = (LineStyleAlphaModifier_DistanceFromCamera *)new_m;
@@ -423,9 +423,9 @@ LineStyleModifier *BKE_copy_linestyle_alpha_modifier(FreestyleLineStyle *linesty
                        q->flags = p->flags;
                        q->range_min = p->range_min;
                        q->range_max = p->range_max;
+                       break;
                }
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
                {
                        LineStyleAlphaModifier_DistanceFromObject *p = (LineStyleAlphaModifier_DistanceFromObject *)m;
                        LineStyleAlphaModifier_DistanceFromObject *q = (LineStyleAlphaModifier_DistanceFromObject *)new_m;
@@ -436,19 +436,19 @@ LineStyleModifier *BKE_copy_linestyle_alpha_modifier(FreestyleLineStyle *linesty
                        q->flags = p->flags;
                        q->range_min = p->range_min;
                        q->range_max = p->range_max;
+                       break;
                }
-               break;
-       case LS_MODIFIER_MATERIAL:
+               case LS_MODIFIER_MATERIAL:
                {
                        LineStyleAlphaModifier_Material *p = (LineStyleAlphaModifier_Material *)m;
                        LineStyleAlphaModifier_Material *q = (LineStyleAlphaModifier_Material *)new_m;
                        q->curve = curvemapping_copy(p->curve);
                        q->flags = p->flags;
                        q->mat_attr = p->mat_attr;
+                       break;
                }
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               default:
+                       return NULL; /* unknown modifier type */
        }
        add_to_modifier_list(&linestyle->alpha_modifiers, new_m);
 
@@ -458,18 +458,18 @@ LineStyleModifier *BKE_copy_linestyle_alpha_modifier(FreestyleLineStyle *linesty
 void BKE_remove_linestyle_alpha_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
 {
        switch (m->type) {
-       case LS_MODIFIER_ALONG_STROKE:
-               curvemapping_free(((LineStyleAlphaModifier_AlongStroke *)m)->curve);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-               curvemapping_free(((LineStyleAlphaModifier_DistanceFromCamera *)m)->curve);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-               curvemapping_free(((LineStyleAlphaModifier_DistanceFromObject *)m)->curve);
-               break;
-       case LS_MODIFIER_MATERIAL:
-               curvemapping_free(((LineStyleAlphaModifier_Material *)m)->curve);
-               break;
+               case LS_MODIFIER_ALONG_STROKE:
+                       curvemapping_free(((LineStyleAlphaModifier_AlongStroke *)m)->curve);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+                       curvemapping_free(((LineStyleAlphaModifier_DistanceFromCamera *)m)->curve);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+                       curvemapping_free(((LineStyleAlphaModifier_DistanceFromObject *)m)->curve);
+                       break;
+               case LS_MODIFIER_MATERIAL:
+                       curvemapping_free(((LineStyleAlphaModifier_Material *)m)->curve);
+                       break;
        }
        BLI_freelinkN(&linestyle->alpha_modifiers, m);
 }
@@ -479,23 +479,23 @@ static LineStyleModifier *alloc_thickness_modifier(int type)
        size_t size;
 
        switch (type) {
-       case LS_MODIFIER_ALONG_STROKE:
-               size = sizeof(LineStyleThicknessModifier_AlongStroke);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-               size = sizeof(LineStyleThicknessModifier_DistanceFromCamera);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-               size = sizeof(LineStyleThicknessModifier_DistanceFromObject);
-               break;
-       case LS_MODIFIER_MATERIAL:
-               size = sizeof(LineStyleThicknessModifier_Material);
-               break;
-       case LS_MODIFIER_CALLIGRAPHY:
-               size = sizeof(LineStyleThicknessModifier_Calligraphy);
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               case LS_MODIFIER_ALONG_STROKE:
+                       size = sizeof(LineStyleThicknessModifier_AlongStroke);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+                       size = sizeof(LineStyleThicknessModifier_DistanceFromCamera);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+                       size = sizeof(LineStyleThicknessModifier_DistanceFromObject);
+                       break;
+               case LS_MODIFIER_MATERIAL:
+                       size = sizeof(LineStyleThicknessModifier_Material);
+                       break;
+               case LS_MODIFIER_CALLIGRAPHY:
+                       size = sizeof(LineStyleThicknessModifier_Calligraphy);
+                       break;
+               default:
+                       return NULL; /* unknown modifier type */
        }
 
        return new_modifier(type, size);
@@ -509,15 +509,15 @@ LineStyleModifier *BKE_add_linestyle_thickness_modifier(FreestyleLineStyle *line
        m->blend = LS_VALUE_BLEND;
 
        switch (type) {
-       case LS_MODIFIER_ALONG_STROKE:
+               case LS_MODIFIER_ALONG_STROKE:
                {
                        LineStyleThicknessModifier_AlongStroke *p = (LineStyleThicknessModifier_AlongStroke *)m;
                        p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
                        p->value_min = 0.0f;
                        p->value_max = 1.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
                {
                        LineStyleThicknessModifier_DistanceFromCamera *p = (LineStyleThicknessModifier_DistanceFromCamera *)m;
                        p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
@@ -525,9 +525,9 @@ LineStyleModifier *BKE_add_linestyle_thickness_modifier(FreestyleLineStyle *line
                        p->range_max = 1000.0f;
                        p->value_min = 0.0f;
                        p->value_max = 1.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
                {
                        LineStyleThicknessModifier_DistanceFromObject *p = (LineStyleThicknessModifier_DistanceFromObject *)m;
                        p->target = NULL;
@@ -536,27 +536,27 @@ LineStyleModifier *BKE_add_linestyle_thickness_modifier(FreestyleLineStyle *line
                        p->range_max = 1000.0f;
                        p->value_min = 0.0f;
                        p->value_max = 1.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_MATERIAL:
+               case LS_MODIFIER_MATERIAL:
                {
                        LineStyleThicknessModifier_Material *p = (LineStyleThicknessModifier_Material *)m;
                        p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
                        p->mat_attr = LS_MODIFIER_MATERIAL_DIFF;
                        p->value_min = 0.0f;
                        p->value_max = 1.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_CALLIGRAPHY:
+               case LS_MODIFIER_CALLIGRAPHY:
                {
                        LineStyleThicknessModifier_Calligraphy *p = (LineStyleThicknessModifier_Calligraphy *)m;
                        p->min_thickness = 1.0f;
                        p->max_thickness = 10.0f;
                        p->orientation = DEG2RADF(60.0f);
+                       break;
                }
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               default:
+                       return NULL; /* unknown modifier type */
        }
        add_to_modifier_list(&linestyle->thickness_modifiers, m);
 
@@ -575,7 +575,7 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
        new_m->blend = m->blend;
 
        switch (m->type) {
-       case LS_MODIFIER_ALONG_STROKE:
+               case LS_MODIFIER_ALONG_STROKE:
                {
                        LineStyleThicknessModifier_AlongStroke *p = (LineStyleThicknessModifier_AlongStroke *)m;
                        LineStyleThicknessModifier_AlongStroke *q = (LineStyleThicknessModifier_AlongStroke *)new_m;
@@ -583,9 +583,9 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
                        q->flags = p->flags;
                        q->value_min = p->value_min;
                        q->value_max = p->value_max;
+                       break;
                }
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
                {
                        LineStyleThicknessModifier_DistanceFromCamera *p = (LineStyleThicknessModifier_DistanceFromCamera *)m;
                        LineStyleThicknessModifier_DistanceFromCamera *q = (LineStyleThicknessModifier_DistanceFromCamera *)new_m;
@@ -595,9 +595,9 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
                        q->range_max = p->range_max;
                        q->value_min = p->value_min;
                        q->value_max = p->value_max;
+                       break;
                }
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
                {
                        LineStyleThicknessModifier_DistanceFromObject *p = (LineStyleThicknessModifier_DistanceFromObject *)m;
                        LineStyleThicknessModifier_DistanceFromObject *q = (LineStyleThicknessModifier_DistanceFromObject *)new_m;
@@ -610,9 +610,9 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
                        q->range_max = p->range_max;
                        q->value_min = p->value_min;
                        q->value_max = p->value_max;
+                       break;
                }
-               break;
-       case LS_MODIFIER_MATERIAL:
+               case LS_MODIFIER_MATERIAL:
                {
                        LineStyleThicknessModifier_Material *p = (LineStyleThicknessModifier_Material *)m;
                        LineStyleThicknessModifier_Material *q = (LineStyleThicknessModifier_Material *)new_m;
@@ -621,19 +621,19 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
                        q->mat_attr = p->mat_attr;
                        q->value_min = p->value_min;
                        q->value_max = p->value_max;
+                       break;
                }
-               break;
-       case LS_MODIFIER_CALLIGRAPHY:
+               case LS_MODIFIER_CALLIGRAPHY:
                {
                        LineStyleThicknessModifier_Calligraphy *p = (LineStyleThicknessModifier_Calligraphy *)m;
                        LineStyleThicknessModifier_Calligraphy *q = (LineStyleThicknessModifier_Calligraphy *)new_m;
                        q->min_thickness = p->min_thickness;
                        q->max_thickness = p->max_thickness;
                        q->orientation = p->orientation;
+                       break;
                }
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               default:
+                       return NULL; /* unknown modifier type */
        }
        add_to_modifier_list(&linestyle->thickness_modifiers, new_m);
 
@@ -643,20 +643,20 @@ LineStyleModifier *BKE_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
 void BKE_remove_linestyle_thickness_modifier(FreestyleLineStyle *linestyle, LineStyleModifier *m)
 {
        switch (m->type) {
-       case LS_MODIFIER_ALONG_STROKE:
-               curvemapping_free(((LineStyleThicknessModifier_AlongStroke *)m)->curve);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-               curvemapping_free(((LineStyleThicknessModifier_DistanceFromCamera *)m)->curve);
-               break;
-       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-               curvemapping_free(((LineStyleThicknessModifier_DistanceFromObject *)m)->curve);
-               break;
-       case LS_MODIFIER_MATERIAL:
-               curvemapping_free(((LineStyleThicknessModifier_Material *)m)->curve);
-               break;
-       case LS_MODIFIER_CALLIGRAPHY:
-               break;
+               case LS_MODIFIER_ALONG_STROKE:
+                       curvemapping_free(((LineStyleThicknessModifier_AlongStroke *)m)->curve);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+                       curvemapping_free(((LineStyleThicknessModifier_DistanceFromCamera *)m)->curve);
+                       break;
+               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+                       curvemapping_free(((LineStyleThicknessModifier_DistanceFromObject *)m)->curve);
+                       break;
+               case LS_MODIFIER_MATERIAL:
+                       curvemapping_free(((LineStyleThicknessModifier_Material *)m)->curve);
+                       break;
+               case LS_MODIFIER_CALLIGRAPHY:
+                       break;
        }
        BLI_freelinkN(&linestyle->thickness_modifiers, m);
 }
@@ -666,47 +666,47 @@ static LineStyleModifier *alloc_geometry_modifier(int type)
        size_t size;
 
        switch (type) {
-       case LS_MODIFIER_SAMPLING:
-               size = sizeof(LineStyleGeometryModifier_Sampling);
-               break;
-       case LS_MODIFIER_BEZIER_CURVE:
-               size = sizeof(LineStyleGeometryModifier_BezierCurve);
-               break;
-       case LS_MODIFIER_SINUS_DISPLACEMENT:
-               size = sizeof(LineStyleGeometryModifier_SinusDisplacement);
-               break;
-       case LS_MODIFIER_SPATIAL_NOISE:
-               size = sizeof(LineStyleGeometryModifier_SpatialNoise);
-               break;
-       case LS_MODIFIER_PERLIN_NOISE_1D:
-               size = sizeof(LineStyleGeometryModifier_PerlinNoise1D);
-               break;
-       case LS_MODIFIER_PERLIN_NOISE_2D:
-               size = sizeof(LineStyleGeometryModifier_PerlinNoise2D);
-               break;
-       case LS_MODIFIER_BACKBONE_STRETCHER:
-               size = sizeof(LineStyleGeometryModifier_BackboneStretcher);
-               break;
-       case LS_MODIFIER_TIP_REMOVER:
-               size = sizeof(LineStyleGeometryModifier_TipRemover);
-               break;
-       case LS_MODIFIER_POLYGONIZATION:
-               size = sizeof(LineStyleGeometryModifier_Polygonalization);
-               break;
-       case LS_MODIFIER_GUIDING_LINES:
-               size = sizeof(LineStyleGeometryModifier_GuidingLines);
-               break;
-       case LS_MODIFIER_BLUEPRINT:
-               size = sizeof(LineStyleGeometryModifier_Blueprint);
-               break;
-       case LS_MODIFIER_2D_OFFSET:
-               size = sizeof(LineStyleGeometryModifier_2DOffset);
-               break;
-       case LS_MODIFIER_2D_TRANSFORM:
-               size = sizeof(LineStyleGeometryModifier_2DTransform);
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               case LS_MODIFIER_SAMPLING:
+                       size = sizeof(LineStyleGeometryModifier_Sampling);
+                       break;
+               case LS_MODIFIER_BEZIER_CURVE:
+                       size = sizeof(LineStyleGeometryModifier_BezierCurve);
+                       break;
+               case LS_MODIFIER_SINUS_DISPLACEMENT:
+                       size = sizeof(LineStyleGeometryModifier_SinusDisplacement);
+                       break;
+               case LS_MODIFIER_SPATIAL_NOISE:
+                       size = sizeof(LineStyleGeometryModifier_SpatialNoise);
+                       break;
+               case LS_MODIFIER_PERLIN_NOISE_1D:
+                       size = sizeof(LineStyleGeometryModifier_PerlinNoise1D);
+                       break;
+               case LS_MODIFIER_PERLIN_NOISE_2D:
+                       size = sizeof(LineStyleGeometryModifier_PerlinNoise2D);
+                       break;
+               case LS_MODIFIER_BACKBONE_STRETCHER:
+                       size = sizeof(LineStyleGeometryModifier_BackboneStretcher);
+                       break;
+               case LS_MODIFIER_TIP_REMOVER:
+                       size = sizeof(LineStyleGeometryModifier_TipRemover);
+                       break;
+               case LS_MODIFIER_POLYGONIZATION:
+                       size = sizeof(LineStyleGeometryModifier_Polygonalization);
+                       break;
+               case LS_MODIFIER_GUIDING_LINES:
+                       size = sizeof(LineStyleGeometryModifier_GuidingLines);
+                       break;
+               case LS_MODIFIER_BLUEPRINT:
+                       size = sizeof(LineStyleGeometryModifier_Blueprint);
+                       break;
+               case LS_MODIFIER_2D_OFFSET:
+                       size = sizeof(LineStyleGeometryModifier_2DOffset);
+                       break;
+               case LS_MODIFIER_2D_TRANSFORM:
+                       size = sizeof(LineStyleGeometryModifier_2DTransform);
+                       break;
+               default:
+                       return NULL; /* unknown modifier type */
        }
 
        return new_modifier(type, size);
@@ -719,78 +719,78 @@ LineStyleModifier *BKE_add_linestyle_geometry_modifier(FreestyleLineStyle *lines
        m = alloc_geometry_modifier(type);
 
        switch (type) {
-       case LS_MODIFIER_SAMPLING:
+               case LS_MODIFIER_SAMPLING:
                {
                        LineStyleGeometryModifier_Sampling *p = (LineStyleGeometryModifier_Sampling *)m;
                        p->sampling = 10.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_BEZIER_CURVE:
+               case LS_MODIFIER_BEZIER_CURVE:
                {
                        LineStyleGeometryModifier_BezierCurve *p = (LineStyleGeometryModifier_BezierCurve *)m;
                        p->error = 10.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_SINUS_DISPLACEMENT:
+               case LS_MODIFIER_SINUS_DISPLACEMENT:
                {
                        LineStyleGeometryModifier_SinusDisplacement *p = (LineStyleGeometryModifier_SinusDisplacement *)m;
                        p->wavelength = 20.0f;
                        p->amplitude = 5.0f;
                        p->phase = 0.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_SPATIAL_NOISE:
+               case LS_MODIFIER_SPATIAL_NOISE:
                {
                        LineStyleGeometryModifier_SpatialNoise *p = (LineStyleGeometryModifier_SpatialNoise *)m;
                        p->amplitude = 5.0f;
                        p->scale = 20.0f;
                        p->octaves = 4;
                        p->flags = LS_MODIFIER_SPATIAL_NOISE_SMOOTH | LS_MODIFIER_SPATIAL_NOISE_PURERANDOM;
+                       break;
                }
-               break;
-       case LS_MODIFIER_PERLIN_NOISE_1D:
+               case LS_MODIFIER_PERLIN_NOISE_1D:
                {
                        LineStyleGeometryModifier_PerlinNoise1D *p = (LineStyleGeometryModifier_PerlinNoise1D *)m;
                        p->frequency = 10.0f;
                        p->amplitude = 10.0f;
                        p->octaves = 4;
                        p->angle = DEG2RADF(45.0f);
+                       break;
                }
-               break;
-       case LS_MODIFIER_PERLIN_NOISE_2D:
+               case LS_MODIFIER_PERLIN_NOISE_2D:
                {
                        LineStyleGeometryModifier_PerlinNoise2D *p = (LineStyleGeometryModifier_PerlinNoise2D *)m;
                        p->frequency = 10.0f;
                        p->amplitude = 10.0f;
                        p->octaves = 4;
                        p->angle = DEG2RADF(45.0f);
+                       break;
                }
-               break;
-       case LS_MODIFIER_BACKBONE_STRETCHER:
+               case LS_MODIFIER_BACKBONE_STRETCHER:
                {
                        LineStyleGeometryModifier_BackboneStretcher *p = (LineStyleGeometryModifier_BackboneStretcher *)m;
                        p->backbone_length = 10.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_TIP_REMOVER:
+               case LS_MODIFIER_TIP_REMOVER:
                {
                        LineStyleGeometryModifier_TipRemover *p = (LineStyleGeometryModifier_TipRemover *)m;
                        p->tip_length = 10.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_POLYGONIZATION:
+               case LS_MODIFIER_POLYGONIZATION:
                {
                        LineStyleGeometryModifier_Polygonalization *p = (LineStyleGeometryModifier_Polygonalization *)m;
                        p->error = 10.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_GUIDING_LINES:
+               case LS_MODIFIER_GUIDING_LINES:
                {
                        LineStyleGeometryModifier_GuidingLines *p = (LineStyleGeometryModifier_GuidingLines *)m;
                        p->offset = 0.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_BLUEPRINT:
+               case LS_MODIFIER_BLUEPRINT:
                {
                        LineStyleGeometryModifier_Blueprint *p = (LineStyleGeometryModifier_Blueprint *)m;
                        p->flags = LS_MODIFIER_BLUEPRINT_CIRCLES;
@@ -799,18 +799,18 @@ LineStyleModifier *BKE_add_linestyle_geometry_modifier(FreestyleLineStyle *lines
                        p->random_radius = 3;
                        p->random_center = 5;
                        p->random_backbone = 5;
+                       break;
                }
-               break;
-       case LS_MODIFIER_2D_OFFSET:
+               case LS_MODIFIER_2D_OFFSET:
                {
                        LineStyleGeometryModifier_2DOffset *p = (LineStyleGeometryModifier_2DOffset *)m;
                        p->start = 0.0f;
                        p->end = 0.0f;
                        p->x = 0.0f;
                        p->y = 0.0f;
+                       break;
                }
-               break;
-       case LS_MODIFIER_2D_TRANSFORM:
+               case LS_MODIFIER_2D_TRANSFORM:
                {
                        LineStyleGeometryModifier_2DTransform *p = (LineStyleGeometryModifier_2DTransform *)m;
                        p->pivot = LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER;
@@ -820,10 +820,10 @@ LineStyleModifier *BKE_add_linestyle_geometry_modifier(FreestyleLineStyle *lines
                        p->pivot_u = 0.5f;
                        p->pivot_x = 0.0f;
                        p->pivot_y = 0.0f;
+                       break;
                }
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               default:
+                       return NULL; /* unknown modifier type */
        }
        add_to_modifier_list(&linestyle->geometry_modifiers, m);
 
@@ -838,30 +838,30 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
        new_m->flags = m->flags;
 
        switch (m->type) {
-       case LS_MODIFIER_SAMPLING:
+               case LS_MODIFIER_SAMPLING:
                {
                        LineStyleGeometryModifier_Sampling *p = (LineStyleGeometryModifier_Sampling *)m;
                        LineStyleGeometryModifier_Sampling *q = (LineStyleGeometryModifier_Sampling *)new_m;
                        q->sampling = p->sampling;
+                       break;
                }
-               break;
-       case LS_MODIFIER_BEZIER_CURVE:
+               case LS_MODIFIER_BEZIER_CURVE:
                {
                        LineStyleGeometryModifier_BezierCurve *p = (LineStyleGeometryModifier_BezierCurve *)m;
                        LineStyleGeometryModifier_BezierCurve *q = (LineStyleGeometryModifier_BezierCurve *)new_m;
                        q->error = p->error;
+                       break;
                }
-               break;
-       case LS_MODIFIER_SINUS_DISPLACEMENT:
+               case LS_MODIFIER_SINUS_DISPLACEMENT:
                {
                        LineStyleGeometryModifier_SinusDisplacement *p = (LineStyleGeometryModifier_SinusDisplacement *)m;
                        LineStyleGeometryModifier_SinusDisplacement *q = (LineStyleGeometryModifier_SinusDisplacement *)new_m;
                        q->wavelength = p->wavelength;
                        q->amplitude = p->amplitude;
                        q->phase = p->phase;
+                       break;
                }
-               break;
-       case LS_MODIFIER_SPATIAL_NOISE:
+               case LS_MODIFIER_SPATIAL_NOISE:
                {
                        LineStyleGeometryModifier_SpatialNoise *p = (LineStyleGeometryModifier_SpatialNoise *)m;
                        LineStyleGeometryModifier_SpatialNoise *q = (LineStyleGeometryModifier_SpatialNoise *)new_m;
@@ -869,9 +869,9 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
                        q->scale = p->scale;
                        q->octaves = p->octaves;
                        q->flags = p->flags;
+                       break;
                }
-               break;
-       case LS_MODIFIER_PERLIN_NOISE_1D:
+               case LS_MODIFIER_PERLIN_NOISE_1D:
                {
                        LineStyleGeometryModifier_PerlinNoise1D *p = (LineStyleGeometryModifier_PerlinNoise1D *)m;
                        LineStyleGeometryModifier_PerlinNoise1D *q = (LineStyleGeometryModifier_PerlinNoise1D *)new_m;
@@ -880,9 +880,9 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
                        q->angle = p->angle;
                        q->octaves = p->octaves;
                        q->seed = p->seed;
+                       break;
                }
-               break;
-       case LS_MODIFIER_PERLIN_NOISE_2D:
+               case LS_MODIFIER_PERLIN_NOISE_2D:
                {
                        LineStyleGeometryModifier_PerlinNoise2D *p = (LineStyleGeometryModifier_PerlinNoise2D *)m;
                        LineStyleGeometryModifier_PerlinNoise2D *q = (LineStyleGeometryModifier_PerlinNoise2D *)new_m;
@@ -891,37 +891,37 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
                        q->angle = p->angle;
                        q->octaves = p->octaves;
                        q->seed = p->seed;
+                       break;
                }
-               break;
-       case LS_MODIFIER_BACKBONE_STRETCHER:
+               case LS_MODIFIER_BACKBONE_STRETCHER:
                {
                        LineStyleGeometryModifier_BackboneStretcher *p = (LineStyleGeometryModifier_BackboneStretcher *)m;
                        LineStyleGeometryModifier_BackboneStretcher *q = (LineStyleGeometryModifier_BackboneStretcher *)new_m;
                        q->backbone_length = p->backbone_length;
+                       break;
                }
-               break;
-       case LS_MODIFIER_TIP_REMOVER:
+               case LS_MODIFIER_TIP_REMOVER:
                {
                        LineStyleGeometryModifier_TipRemover *p = (LineStyleGeometryModifier_TipRemover *)m;
                        LineStyleGeometryModifier_TipRemover *q = (LineStyleGeometryModifier_TipRemover *)new_m;
                        q->tip_length = p->tip_length;
+                       break;
                }
-               break;
-       case LS_MODIFIER_POLYGONIZATION:
+               case LS_MODIFIER_POLYGONIZATION:
                {
                        LineStyleGeometryModifier_Polygonalization *p = (LineStyleGeometryModifier_Polygonalization *)m;
                        LineStyleGeometryModifier_Polygonalization *q = (LineStyleGeometryModifier_Polygonalization *)new_m;
                        q->error = p->error;
+                       break;
                }
-               break;
-       case LS_MODIFIER_GUIDING_LINES:
+               case LS_MODIFIER_GUIDING_LINES:
                {
                        LineStyleGeometryModifier_GuidingLines *p = (LineStyleGeometryModifier_GuidingLines *)m;
                        LineStyleGeometryModifier_GuidingLines *q = (LineStyleGeometryModifier_GuidingLines *)new_m;
                        q->offset = p->offset;
+                       break;
                }
-               break;
-       case LS_MODIFIER_BLUEPRINT:
+               case LS_MODIFIER_BLUEPRINT:
                {
                        LineStyleGeometryModifier_Blueprint *p = (LineStyleGeometryModifier_Blueprint *)m;
                        LineStyleGeometryModifier_Blueprint *q = (LineStyleGeometryModifier_Blueprint *)new_m;
@@ -931,9 +931,9 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
                        q->random_radius = p->random_radius;
                        q->random_center = p->random_center;
                        q->random_backbone = p->random_backbone;
+                       break;
                }
-               break;
-       case LS_MODIFIER_2D_OFFSET:
+               case LS_MODIFIER_2D_OFFSET:
                {
                        LineStyleGeometryModifier_2DOffset *p = (LineStyleGeometryModifier_2DOffset *)m;
                        LineStyleGeometryModifier_2DOffset *q = (LineStyleGeometryModifier_2DOffset *)new_m;
@@ -941,9 +941,9 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
                        q->end = p->end;
                        q->x = p->x;
                        q->y = p->y;
+                       break;
                }
-               break;
-       case LS_MODIFIER_2D_TRANSFORM:
+               case LS_MODIFIER_2D_TRANSFORM:
                {
                        LineStyleGeometryModifier_2DTransform *p = (LineStyleGeometryModifier_2DTransform *)m;
                        LineStyleGeometryModifier_2DTransform *q = (LineStyleGeometryModifier_2DTransform *)new_m;
@@ -954,10 +954,10 @@ LineStyleModifier *BKE_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
                        q->pivot_u = p->pivot_u;
                        q->pivot_x = p->pivot_x;
                        q->pivot_y = p->pivot_y;
+                       break;
                }
-               break;
-       default:
-               return NULL; /* unknown modifier type */
+               default:
+                       return NULL; /* unknown modifier type */
        }
        add_to_modifier_list(&linestyle->geometry_modifiers, new_m);
 
@@ -1007,20 +1007,20 @@ void BKE_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *list
        listbase->first = listbase->last = NULL;
        for (m = (LineStyleModifier *)linestyle->color_modifiers.first; m; m = m->next) {
                switch (m->type) {
-               case LS_MODIFIER_ALONG_STROKE:
-                       color_ramp = ((LineStyleColorModifier_AlongStroke *)m)->color_ramp;
-                       break;
-               case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-                       color_ramp = ((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp;
-                       break;
-               case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-                       color_ramp = ((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp;
-                       break;
-               case LS_MODIFIER_MATERIAL:
-                       color_ramp = ((LineStyleColorModifier_Material *)m)->color_ramp;
-                       break;
-               default:
-                       continue;
+                       case LS_MODIFIER_ALONG_STROKE:
+                               color_ramp = ((LineStyleColorModifier_AlongStroke *)m)->color_ramp;
+                               break;
+                       case LS_MODIFIER_DISTANCE_FROM_CAMERA:
+                               color_ramp = ((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp;
+                               break;
+                       case LS_MODIFIER_DISTANCE_FROM_OBJECT:
+                               color_ramp = ((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp;
+                               break;
+                       case LS_MODIFIER_MATERIAL:
+                               color_ramp = ((LineStyleColorModifier_Material *)m)->color_ramp;
+                               break;
+                       default:
+                               continue;
                }
                link = (LinkData *) MEM_callocN( sizeof(LinkData), "link to color ramp");
                link->data = color_ramp;
index e68f87211eb90842117e6b175ec319c084ef5551..ac48eaa3185b76b7704de9926c00f55a008141cc 100644 (file)
@@ -496,10 +496,10 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size)
 
                                        /* this should _almost_ never happen but since it can in extreme cases,
                                         * we have to clamp the values or we overrun the buffer and crash */
-                                       CLAMP(xi_min, 0, layer->buckets_x - 1);
-                                       CLAMP(xi_max, 0, layer->buckets_x - 1);
-                                       CLAMP(yi_min, 0, layer->buckets_y - 1);
-                                       CLAMP(yi_max, 0, layer->buckets_y - 1);
+                                       if (xi_min >= layer->buckets_x) xi_min = layer->buckets_x - 1;
+                                       if (xi_max >= layer->buckets_x) xi_max = layer->buckets_x - 1;
+                                       if (yi_min >= layer->buckets_y) yi_min = layer->buckets_y - 1;
+                                       if (yi_max >= layer->buckets_y) yi_max = layer->buckets_y - 1;
 
                                        for (yi = yi_min; yi <= yi_max; yi++) {
                                                unsigned int bucket_index = (layer->buckets_x * yi) + xi_min;
index efa00cdb77f264bd866a96de4f69bfd217d0b36b..5f9aafa219f14d7f70e310d16d753e9beadff8e9 100644 (file)
@@ -1432,8 +1432,8 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
                                r_col[1] = facm * (r_col[1]) + fac * tmpg;
                                r_col[2] = facm * (r_col[2]) + fac * tmpb;
                        }
+                       break;
                }
-               break;
                case MA_RAMP_SAT:
                {
                        float rH, rS, rV;
@@ -1443,8 +1443,8 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
                                rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
                                hsv_to_rgb(rH, (facm * rS + fac * colS), rV, r_col + 0, r_col + 1, r_col + 2);
                        }
+                       break;
                }
-               break;
                case MA_RAMP_VAL:
                {
                        float rH, rS, rV;
@@ -1452,8 +1452,8 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
                        rgb_to_hsv(r_col[0], r_col[1], r_col[2], &rH, &rS, &rV);
                        rgb_to_hsv(col[0], col[1], col[2], &colH, &colS, &colV);
                        hsv_to_rgb(rH, rS, (facm * rV + fac * colV), r_col + 0, r_col + 1, r_col + 2);
+                       break;
                }
-               break;
                case MA_RAMP_COLOR:
                {
                        float rH, rS, rV;
@@ -1467,8 +1467,8 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
                                r_col[1] = facm * (r_col[1]) + fac * tmpg;
                                r_col[2] = facm * (r_col[2]) + fac * tmpb;
                        }
+                       break;
                }
-               break;
                case MA_RAMP_SOFT:
                {
                        float scr, scg, scb;
@@ -1481,8 +1481,8 @@ void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
                        r_col[0] = facm * (r_col[0]) + fac * (((1.0f - r_col[0]) * col[0] * (r_col[0])) + (r_col[0] * scr));
                        r_col[1] = facm * (r_col[1]) + fac * (((1.0f - r_col[1]) * col[1] * (r_col[1])) + (r_col[1] * scg));
                        r_col[2] = facm * (r_col[2]) + fac * (((1.0f - r_col[2]) * col[2] * (r_col[2])) + (r_col[2] * scb));
+                       break;
                }
-               break;
                case MA_RAMP_LINEAR:
                        if (col[0] > 0.5f)
                                r_col[0] = r_col[0] + fac * (2.0f * (col[0] - 0.5f));
index 95e45bce623c5df816f98d62e8d4b1df1fcdf0f4..49827a5df22c74b16216c862e76a7915d2874541 100644 (file)
@@ -2203,10 +2203,13 @@ static void bm_corners_to_loops_ex(ID *id, CustomData *fdata, CustomData *ldata,
                                if (ld->disps)
                                        MEM_freeN(ld->disps);
 
-                               ld->disps = MEM_callocN(sizeof(float) * 3 * side * side, "converted loop mdisps");
+                               ld->disps = MEM_mallocN(sizeof(float) * 3 * side * side, "converted loop mdisps");
                                if (fd->disps) {
                                        memcpy(ld->disps, disps, sizeof(float) * 3 * side * side);
                                }
+                               else {
+                                       memset(ld->disps, 0, sizeof(float) * 3 * side * side);
+                               }
                        }
                }
        }
index 1d662ae3116038d439573b05926fdeefd0312d07..75e6ce9837df0bd1f893397af51c92d228538490 100644 (file)
@@ -440,6 +440,9 @@ int buildNavMeshDataByDerivedMesh(DerivedMesh *dm, int *vertsPerPoly,
        int ntris = 0, *recastData = NULL;
        unsigned short *tris = NULL;
 
+       /* Don't bother converting if there is nothing to convert */
+       if (!*nverts) return 0;
+
        res = buildRawVertIndicesData(dm, nverts, verts, &ntris, &tris, trisToFacesMap, &recastData);
        if (!res) {
                printf("Converting navmesh: Error! Can't get vertices and indices from mesh\n");
index 386b50c7018e2023e6de48e746fbf04be4901519..84dfa70abfcb00d89b1dc5465128afd1d6aaec7b 100644 (file)
@@ -525,60 +525,60 @@ bNodeSocket *nodeInsertSocket(bNodeTree *ntree, bNode *node, int in_out, const c
 const char *nodeStaticSocketType(int type, int subtype)
 {
        switch (type) {
-       case SOCK_FLOAT:
-               switch (subtype) {
-               case PROP_UNSIGNED:
-                       return "NodeSocketFloatUnsigned";
-               case PROP_PERCENTAGE:
-                       return "NodeSocketFloatPercentage";
-               case PROP_FACTOR:
-                       return "NodeSocketFloatFactor";
-               case PROP_ANGLE:
-                       return "NodeSocketFloatAngle";
-               case PROP_TIME:
-                       return "NodeSocketFloatTime";
-               case PROP_NONE:
-               default:
-                       return "NodeSocketFloat";
-               }
-       case SOCK_INT:
-               switch (subtype) {
-               case PROP_UNSIGNED:
-                       return "NodeSocketIntUnsigned";
-               case PROP_PERCENTAGE:
-                       return "NodeSocketIntPercentage";
-               case PROP_FACTOR:
-                       return "NodeSocketIntFactor";
-               case PROP_NONE:
-               default:
-                       return "NodeSocketInt";
-               }
-       case SOCK_BOOLEAN:
-               return "NodeSocketBool";
-       case SOCK_VECTOR:
-               switch (subtype) {
-               case PROP_TRANSLATION:
-                       return "NodeSocketVectorTranslation";
-               case PROP_DIRECTION:
-                       return "NodeSocketVectorDirection";
-               case PROP_VELOCITY:
-                       return "NodeSocketVectorVelocity";
-               case PROP_ACCELERATION:
-                       return "NodeSocketVectorAcceleration";
-               case PROP_EULER:
-                       return "NodeSocketVectorEuler";
-               case PROP_XYZ:
-                       return "NodeSocketVectorXYZ";
-               case PROP_NONE:
-               default:
-                       return "NodeSocketVector";
-               }
-       case SOCK_RGBA:
-               return "NodeSocketColor";
-       case SOCK_STRING:
-               return "NodeSocketString";
-       case SOCK_SHADER:
-               return "NodeSocketShader";
+               case SOCK_FLOAT:
+                       switch (subtype) {
+                               case PROP_UNSIGNED:
+                                       return "NodeSocketFloatUnsigned";
+                               case PROP_PERCENTAGE:
+                                       return "NodeSocketFloatPercentage";
+                               case PROP_FACTOR:
+                                       return "NodeSocketFloatFactor";
+                               case PROP_ANGLE:
+                                       return "NodeSocketFloatAngle";
+                               case PROP_TIME:
+                                       return "NodeSocketFloatTime";
+                               case PROP_NONE:
+                               default:
+                                       return "NodeSocketFloat";
+                       }
+               case SOCK_INT:
+                       switch (subtype) {
+                               case PROP_UNSIGNED:
+                                       return "NodeSocketIntUnsigned";
+                               case PROP_PERCENTAGE:
+                                       return "NodeSocketIntPercentage";
+                               case PROP_FACTOR:
+                                       return "NodeSocketIntFactor";
+                               case PROP_NONE:
+                               default:
+                                       return "NodeSocketInt";
+                       }
+               case SOCK_BOOLEAN:
+                       return "NodeSocketBool";
+               case SOCK_VECTOR:
+                       switch (subtype) {
+                               case PROP_TRANSLATION:
+                                       return "NodeSocketVectorTranslation";
+                               case PROP_DIRECTION:
+                                       return "NodeSocketVectorDirection";
+                               case PROP_VELOCITY:
+                                       return "NodeSocketVectorVelocity";
+                               case PROP_ACCELERATION:
+                                       return "NodeSocketVectorAcceleration";
+                               case PROP_EULER:
+                                       return "NodeSocketVectorEuler";
+                               case PROP_XYZ:
+                                       return "NodeSocketVectorXYZ";
+                               case PROP_NONE:
+                               default:
+                                       return "NodeSocketVector";
+                       }
+               case SOCK_RGBA:
+                       return "NodeSocketColor";
+               case SOCK_STRING:
+                       return "NodeSocketString";
+               case SOCK_SHADER:
+                       return "NodeSocketShader";
        }
        return NULL;
 }
@@ -586,60 +586,60 @@ const char *nodeStaticSocketType(int type, int subtype)
 const char *nodeStaticSocketInterfaceType(int type, int subtype)
 {
        switch (type) {
-       case SOCK_FLOAT:
-               switch (subtype) {
-               case PROP_UNSIGNED:
-                       return "NodeSocketInterfaceFloatUnsigned";
-               case PROP_PERCENTAGE:
-                       return "NodeSocketInterfaceFloatPercentage";
-               case PROP_FACTOR:
-                       return "NodeSocketInterfaceFloatFactor";
-               case PROP_ANGLE:
-                       return "NodeSocketInterfaceFloatAngle";
-               case PROP_TIME:
-                       return "NodeSocketInterfaceFloatTime";
-               case PROP_NONE:
-               default:
-                       return "NodeSocketInterfaceFloat";
-               }
-       case SOCK_INT:
-               switch (subtype) {
-               case PROP_UNSIGNED:
-                       return "NodeSocketInterfaceIntUnsigned";
-               case PROP_PERCENTAGE:
-                       return "NodeSocketInterfaceIntPercentage";
-               case PROP_FACTOR:
-                       return "NodeSocketInterfaceIntFactor";
-               case PROP_NONE:
-               default:
-                       return "NodeSocketInterfaceInt";
-               }
-       case SOCK_BOOLEAN:
-               return "NodeSocketInterfaceBool";
-       case SOCK_VECTOR:
-               switch (subtype) {
-               case PROP_TRANSLATION:
-                       return "NodeSocketInterfaceVectorTranslation";
-               case PROP_DIRECTION:
-                       return "NodeSocketInterfaceVectorDirection";
-               case PROP_VELOCITY:
-                       return "NodeSocketInterfaceVectorVelocity";
-               case PROP_ACCELERATION:
-                       return "NodeSocketInterfaceVectorAcceleration";
-               case PROP_EULER:
-                       return "NodeSocketInterfaceVectorEuler";
-               case PROP_XYZ:
-                       return "NodeSocketInterfaceVectorXYZ";
-               case PROP_NONE:
-               default:
-                       return "NodeSocketInterfaceVector";
-               }
-       case SOCK_RGBA:
-               return "NodeSocketInterfaceColor";
-       case SOCK_STRING:
-               return "NodeSocketInterfaceString";
-       case SOCK_SHADER:
-               return "NodeSocketInterfaceShader";
+               case SOCK_FLOAT:
+                       switch (subtype) {
+                               case PROP_UNSIGNED:
+                                       return "NodeSocketInterfaceFloatUnsigned";
+                               case PROP_PERCENTAGE:
+                                       return "NodeSocketInterfaceFloatPercentage";
+                               case PROP_FACTOR:
+                                       return "NodeSocketInterfaceFloatFactor";
+                               case PROP_ANGLE:
+                                       return "NodeSocketInterfaceFloatAngle";
+                               case PROP_TIME:
+                                       return "NodeSocketInterfaceFloatTime";
+                               case PROP_NONE:
+                               default:
+                                       return "NodeSocketInterfaceFloat";
+                       }
+               case SOCK_INT:
+                       switch (subtype) {
+                               case PROP_UNSIGNED:
+                                       return "NodeSocketInterfaceIntUnsigned";
+                               case PROP_PERCENTAGE:
+                                       return "NodeSocketInterfaceIntPercentage";
+                               case PROP_FACTOR:
+                                       return "NodeSocketInterfaceIntFactor";
+                               case PROP_NONE:
+                               default:
+                                       return "NodeSocketInterfaceInt";
+                       }
+               case SOCK_BOOLEAN:
+                       return "NodeSocketInterfaceBool";
+               case SOCK_VECTOR:
+                       switch (subtype) {
+                               case PROP_TRANSLATION:
+                                       return "NodeSocketInterfaceVectorTranslation";
+                               case PROP_DIRECTION:
+                                       return "NodeSocketInterfaceVectorDirection";
+                               case PROP_VELOCITY:
+                                       return "NodeSocketInterfaceVectorVelocity";
+                               case PROP_ACCELERATION:
+                                       return "NodeSocketInterfaceVectorAcceleration";
+                               case PROP_EULER:
+                                       return "NodeSocketInterfaceVectorEuler";
+                               case PROP_XYZ:
+                                       return "NodeSocketInterfaceVectorXYZ";
+                               case PROP_NONE:
+                               default:
+                                       return "NodeSocketInterfaceVector";
+                       }
+               case SOCK_RGBA:
+                       return "NodeSocketInterfaceColor";
+               case SOCK_STRING:
+                       return "NodeSocketInterfaceString";
+               case SOCK_SHADER:
+                       return "NodeSocketInterfaceShader";
        }
        return NULL;
 }
index cbda864a2ea76bbd18794f56721029c8dc4e1c33..1013fbceff1e7208e699aaa01c9d32632ba3e591 100644 (file)
@@ -1619,13 +1619,15 @@ void BKE_object_mat3_to_rot(Object *ob, float mat[3][3], bool use_compat)
                        normalize_qt_qt(dquat, ob->dquat);
                        invert_qt(dquat);
                        mul_qt_qtqt(ob->quat, dquat, ob->quat);
+                       break;
                }
-               break;
                case ROT_MODE_AXISANGLE:
+               {
                        mat3_to_axis_angle(ob->rotAxis, &ob->rotAngle, mat);
                        sub_v3_v3(ob->rotAxis, ob->drotAxis);
                        ob->rotAngle -= ob->drotAngle;
                        break;
+               }
                default: /* euler */
                {
                        float quat[4];
@@ -2390,8 +2392,8 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
                                minmax_v3v3_v3(min_r, max_r, bb.vec[a]);
                        }
                        change = TRUE;
+                       break;
                }
-               break;
                case OB_LATTICE:
                {
                        Lattice *lt = ob->data;
@@ -2407,9 +2409,10 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
                                }
                        }
                        change = TRUE;
+                       break;
                }
-               break;
                case OB_ARMATURE:
+               {
                        if (ob->pose) {
                                bArmature *arm = ob->data;
                                bPoseChannel *pchan;
@@ -2428,6 +2431,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
                                }
                        }
                        break;
+               }
                case OB_MESH:
                {
                        Mesh *me = BKE_mesh_from_object(ob);
@@ -2441,8 +2445,8 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
                                }
                                change = TRUE;
                        }
+                       break;
                }
-               break;
                case OB_MBALL:
                {
                        float ob_min[3], ob_max[3];
@@ -2741,10 +2745,8 @@ void BKE_object_handle_update_ex(Scene *scene, Object *ob,
                                                makeDerivedMesh(scene, ob, NULL, data_mask, 0);
                                        }
 #endif
-
+                                       break;
                                }
-                               break;
-
                                case OB_ARMATURE:
                                        if (ob->id.lib && ob->proxy_from) {
                                                if (BKE_pose_copy_result(ob->pose, ob->proxy_from->pose) == false) {
index e81afc7efb61d979f650d673a571eef455813310..b080cfcff2f63bdeb2d61f61e044bb303a62ed01 100644 (file)
@@ -179,8 +179,10 @@ static void BKE_sequence_free_ex(Scene *scene, Sequence *seq, const int do_cache
        if (seq->strip)
                seq_free_strip(seq->strip);
 
-       if (seq->anim)
+       if (seq->anim) {
                IMB_free_anim(seq->anim);
+               seq->anim = NULL;
+       }
 
        if (seq->type & SEQ_TYPE_EFFECT) {
                struct SeqEffectHandle sh = BKE_sequence_get_effect(seq);
index 9b5e5070342507c947589d1c06ab085c3a7cb041..26a5dada108e490299046d317b8ca256e433c3f9 100644 (file)
@@ -1970,7 +1970,7 @@ static void ccgDM_drawFacesGLSL(DerivedMesh *dm, DMSetMaterial setMaterial)
 /* Only used by non-editmesh types */
 static void ccgDM_drawMappedFacesMat(DerivedMesh *dm,
                                      void (*setMaterial)(void *userData, int, void *attribs),
-                                     int (*setFace)(void *userData, int index), void *userData)
+                                     bool (*setFace)(void *userData, int index), void *userData)
 {
        CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
        CCGSubSurf *ss = ccgdm->ss;
index f08a51e602cb592705af3beb7216c807bc77b49b..110d67b3d47d28a47fe971f9fb26fd4655ee4a56 100644 (file)
@@ -1072,23 +1072,23 @@ int BKE_ffmpeg_start(struct Scene *scene, RenderData *rd, int rectx, int recty,
                specs.channels = c->channels;
 
                switch (av_get_packed_sample_fmt(c->sample_fmt)) {
-               case AV_SAMPLE_FMT_U8:
-                       specs.format = AUD_FORMAT_U8;
-                       break;
-               case AV_SAMPLE_FMT_S16:
-                       specs.format = AUD_FORMAT_S16;
-                       break;
-               case AV_SAMPLE_FMT_S32:
-                       specs.format = AUD_FORMAT_S32;
-                       break;
-               case AV_SAMPLE_FMT_FLT:
-                       specs.format = AUD_FORMAT_FLOAT32;
-                       break;
-               case AV_SAMPLE_FMT_DBL:
-                       specs.format = AUD_FORMAT_FLOAT64;
-                       break;
-               default:
-                       return -31415;
+                       case AV_SAMPLE_FMT_U8:
+                               specs.format = AUD_FORMAT_U8;
+                               break;
+                       case AV_SAMPLE_FMT_S16:
+                               specs.format = AUD_FORMAT_S16;
+                               break;
+                       case AV_SAMPLE_FMT_S32:
+                               specs.format = AUD_FORMAT_S32;
+                               break;
+                       case AV_SAMPLE_FMT_FLT:
+                               specs.format = AUD_FORMAT_FLOAT32;
+                               break;
+                       case AV_SAMPLE_FMT_DBL:
+                               specs.format = AUD_FORMAT_FLOAT64;
+                               break;
+                       default:
+                               return -31415;
                }
 
                specs.rate = rd->ffcodecdata.audio_mixrate;
index cd5c961d982db58bfb6bc4435690d37b10d71713..a4c72aa26b06a51b0a93a7dace7db38a5fb9aebd 100644 (file)
@@ -72,7 +72,7 @@ struct BVHTree {
 /* optimization, ensure we stay small */
 BLI_STATIC_ASSERT((sizeof(void *) == 8 && sizeof(BVHTree) <= 48) ||
                   (sizeof(void *) == 4 && sizeof(BVHTree) <= 32),
-                  "over sized");
+                  "over sized")
 
 typedef struct BVHOverlapData {
        BVHTree *tree1, *tree2; 
@@ -603,6 +603,7 @@ static void build_implicit_tree_helper(BVHTree *tree, BVHBuildHelper *data)
        data->branches_on_level[0] = 1;
 
        /* We could stop the loop first (but I am lazy to find out when) */
+       /* note: this often causes integer overflow, may be worth avoiding? - campbell */
        for (depth = 1; depth < 32; depth++) {
                data->branches_on_level[depth] = data->branches_on_level[depth - 1] * data->tree_type;
                data->leafs_per_child[depth] = data->leafs_per_child[depth - 1] / data->tree_type;
index 87179a93e839ab38d7845353a7e94d6a5cea74e2..217a4b9d266a3616cbecc117296ac670f4762848 100644 (file)
@@ -437,19 +437,22 @@ void *BLI_mempool_iterstep(BLI_mempool_iter *iter)
 void BLI_mempool_destroy(BLI_mempool *pool)
 {
        BLI_mempool_chunk *mpchunk = NULL;
+       BLI_mempool_chunk *mpchunk_next;
 
        if (pool->flag & BLI_MEMPOOL_SYSMALLOC) {
-               for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
+               for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk_next) {
+                       mpchunk_next = mpchunk->next;
                        free(mpchunk->data);
+                       free(mpchunk);
                }
-               BLI_freelist(&(pool->chunks));
                free(pool);
        }
        else {
-               for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk->next) {
+               for (mpchunk = pool->chunks.first; mpchunk; mpchunk = mpchunk_next) {
+                       mpchunk_next = mpchunk->next;
                        MEM_freeN(mpchunk->data);
+                       MEM_freeN(mpchunk);
                }
-               BLI_freelistN(&(pool->chunks));
                MEM_freeN(pool);
        }
 }
index cb47f07574de4a020101c4d157dee6ba3e484874..31b4b7cd4a5f055cd718a13e9c02d416dfd16e4b 100644 (file)
@@ -539,9 +539,8 @@ DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb,
                                
                                parNode->left = node;
                                node->parent = parNode;
+                               break;
                        }
-                       break;
-                       
                        case 1:  /* add new node as right child */
                        {
                                node = new_cb(data);
@@ -549,15 +548,14 @@ DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb,
                                
                                parNode->right = node;
                                node->parent = parNode;
+                               break;
                        }
-                       break;
-                       
                        default:  /* update the duplicate node as appropriate */
                        {
                                if (update_cb)
                                        update_cb(parNode, data);
+                               break;
                        }
-                       break;
                }
        }
        else {
index 28bb97689d825072119cefd958328ae74303b7ff..0e7ff521ce8e2b34a2e5a38f97f9d7a51c52c44b 100644 (file)
@@ -494,6 +494,7 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
        float a1, a2, b1, b2, c1, c2, d;
        float u, v;
        const float eps = 0.000001f;
+       const float eps_sq = eps * eps;
 
        a1 = v2[0] - v1[0];
        b1 = v4[0] - v3[0];
@@ -510,8 +511,8 @@ int isect_seg_seg_v2_point(const float v1[2], const float v2[2], const float v3[
                        float a[2], b[2], c[2];
                        float u2;
 
-                       if (len_v2v2(v1, v2) == 0.0f) {
-                               if (len_v2v2(v3, v4) > eps) {
+                       if (equals_v2v2(v1, v2)) {
+                               if (len_squared_v2v2(v3, v4) > eps_sq) {
                                        /* use non-point segment as basis */
                                        SWAP(const float *, v1, v3);
                                        SWAP(const float *, v2, v4);
index 96664b776f0d8020e3ee3bab4f2d8fe5c96b53a4..dc0c48cf33fd171c3394fcf3433c1f1a1475bd65 100644 (file)
@@ -1816,7 +1816,7 @@ static int _axis_convert_lut[23][24] = {
        {0x408, 0x810, 0xA20, 0x228, 0x081, 0x891, 0x699, 0x2A9, 0x102, 0x50A,
         0x71A, 0xB22, 0x4CB, 0x8D3, 0xAE3, 0x2EB, 0x144, 0x954, 0x75C, 0x36C,
         0x045, 0x44D, 0x65D, 0xA65},
-       };
+};
 
 // _axis_convert_num = {'X': 0, 'Y': 1, 'Z': 2, '-X': 3, '-Y': 4, '-Z': 5}
 
index 1e76a7f316439e80d7c5efd45a40e0bb55134df9..4c089e9920285d0d2c8050c82941ca338c9dae68 100644 (file)
@@ -610,9 +610,8 @@ bool BLI_parent_dir(char *path)
 {
        static char parent_dir[] = {'.', '.', SEP, '\0'}; /* "../" or "..\\" */
        char tmp[FILE_MAX + 4];
-       BLI_strncpy(tmp, path, sizeof(tmp) - 4);
-       BLI_add_slash(tmp);
-       strcat(tmp, parent_dir);
+
+       BLI_join_dirfile(tmp, sizeof(tmp), path, parent_dir);
        BLI_cleanup_dir(NULL, tmp); /* does all the work of normalizing the path for us */
 
        if (!BLI_testextensie(tmp, parent_dir)) {
index 6b45c6f1cb32a691310ff6970c392e7c249adb41..aeeae000fff18e433786e5325c6dbc6bfdc2221b 100644 (file)
@@ -44,7 +44,7 @@
 
 #if defined(__sun__) || defined(__sun) || defined(__NetBSD__)
 #  include <sys/statvfs.h> /* Other modern unix os's should probably use this also */
-#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
+#elif !defined(__FreeBSD__) && !defined(__linux__) && (defined(__sparc) || defined(__sparc__))
 #  include <sys/statfs.h>
 #endif
 
@@ -53,7 +53,7 @@
 #  include <sys/mount.h>
 #endif
 
-#if defined(linux) || defined(__CYGWIN32__) || defined(__hpux) || defined(__GNU__) || defined(__GLIBC__)
+#if defined(__linux__) || defined(__CYGWIN32__) || defined(__hpux) || defined(__GNU__) || defined(__GLIBC__)
 #include <sys/vfs.h>
 #endif
 
@@ -194,13 +194,13 @@ double BLI_dir_free_space(const char *dir)
                strcpy(name, "/");
        }
 
-#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
+#if defined(__FreeBSD__) || defined(__linux__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__GNU__) || defined(__GLIBC__)
        if (statfs(name, &disk)) return(-1);
 #endif
 
 #if defined(__sun__) || defined(__sun) || defined(__NetBSD__)
        if (statvfs(name, &disk)) return(-1);
-#elif !defined(__FreeBSD__) && !defined(linux) && (defined(__sparc) || defined(__sparc__))
+#elif !defined(__FreeBSD__) && !defined(__linux__) && (defined(__sparc) || defined(__sparc__))
        /* WARNING - This may not be supported by geeneric unix os's - Campbell */
        if (statfs(name, &disk, sizeof(struct statfs), 0)) return(-1);
 #endif
index 159407813b72a344471468262df35b5eaae8a452..33bf44c9843baad69134674ae4949e9d085ec1e8 100644 (file)
@@ -7687,31 +7687,38 @@ static const char *node_get_static_idname(int type, int treetype)
 static const char *node_socket_get_static_idname(bNodeSocket *sock)
 {
        switch (sock->type) {
-       case SOCK_FLOAT: {
-               bNodeSocketValueFloat *dval = sock->default_value;
-               return nodeStaticSocketType(SOCK_FLOAT, dval->subtype);
-       }
-       case SOCK_INT: {
-               bNodeSocketValueInt *dval = sock->default_value;
-               return nodeStaticSocketType(SOCK_INT, dval->subtype);
-       }
-       case SOCK_BOOLEAN: {
-               return nodeStaticSocketType(SOCK_BOOLEAN, PROP_NONE);
-       }
-       case SOCK_VECTOR: {
-               bNodeSocketValueVector *dval = sock->default_value;
-               return nodeStaticSocketType(SOCK_VECTOR, dval->subtype);
-       }
-       case SOCK_RGBA: {
-               return nodeStaticSocketType(SOCK_RGBA, PROP_NONE);
-       }
-       case SOCK_STRING: {
-               bNodeSocketValueString *dval = sock->default_value;
-               return nodeStaticSocketType(SOCK_STRING, dval->subtype);
-       }
-       case SOCK_SHADER: {
-               return nodeStaticSocketType(SOCK_SHADER, PROP_NONE);
-       }
+               case SOCK_FLOAT:
+               {
+                       bNodeSocketValueFloat *dval = sock->default_value;
+                       return nodeStaticSocketType(SOCK_FLOAT, dval->subtype);
+               }
+               case SOCK_INT:
+               {
+                       bNodeSocketValueInt *dval = sock->default_value;
+                       return nodeStaticSocketType(SOCK_INT, dval->subtype);
+               }
+               case SOCK_BOOLEAN:
+               {
+                       return nodeStaticSocketType(SOCK_BOOLEAN, PROP_NONE);
+               }
+               case SOCK_VECTOR:
+               {
+                       bNodeSocketValueVector *dval = sock->default_value;
+                       return nodeStaticSocketType(SOCK_VECTOR, dval->subtype);
+               }
+               case SOCK_RGBA:
+               {
+                       return nodeStaticSocketType(SOCK_RGBA, PROP_NONE);
+               }
+               case SOCK_STRING:
+               {
+                       bNodeSocketValueString *dval = sock->default_value;
+                       return nodeStaticSocketType(SOCK_STRING, dval->subtype);
+               }
+               case SOCK_SHADER:
+               {
+                       return nodeStaticSocketType(SOCK_SHADER, PROP_NONE);
+               }
        }
        return "";
 }
index 7f8b40d85dc507b7b5155785d129d9f6fbd629b0..63c00d5b5456e0cdf92b31cc061c12f8ebaf01e0 100644 (file)
@@ -561,8 +561,6 @@ static int bmo_mesh_flag_count(BMesh *bm, const char htype, const short oflag,
        BMElemF *ele_f;
        int i;
 
-       BLI_assert((unsigned int)test_for_enabled <= 1);
-
        for (i = 0; i < 3; i++) {
                if (htype & flag_types[i]) {
                        BM_ITER_MESH (ele_f, &iter, bm, iter_types[i]) {
@@ -937,7 +935,6 @@ static void bmo_slot_buffer_from_flag(BMesh *bm, BMOperator *op,
        int totelement, i = 0;
 
        BLI_assert(op->slots_in == slot_args || op->slots_out == slot_args);
-       BLI_assert((unsigned int)test_for_enabled <= 1);
 
        if (test_for_enabled)
                totelement = BMO_mesh_enabled_flag_count(bm, htype, oflag);
index ad858c514d20f42a4100647aa5d75c71a3ad0347..e43c04f7d080ae66b4cb08dffd3e3e78529e25eb 100644 (file)
@@ -217,7 +217,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
        /* Continue with ad-hoc fill methods since operators fail,
         * edge, vcloud... may add more */
 
-        if (0) { /* nice feature but perhaps it should be a different tool? */
+       if (0) { /* nice feature but perhaps it should be a different tool? */
 
                /* tricky feature for making a line/edge from selection history...
                 *
index e41fbd69616eeed86153544632d2bc5d0d411696..d65e2669a58dfd3363920139390cdbda3ce8df59 100644 (file)
@@ -130,9 +130,11 @@ static BMFace *copy_face(BMOperator *op,
                          BMOpSlot *slot_facemap_out,
                          BMesh *source_mesh,
                          BMFace *source_face, BMesh *target_mesh,
-                         BMVert **vtar, BMEdge **edar, GHash *vhash, GHash *ehash)
+                         GHash *vhash, GHash *ehash)
 {
        /* BMVert *target_vert1, *target_vert2; */ /* UNUSED */
+       BMVert **vtar = BLI_array_alloca(vtar, source_face->len);
+       BMEdge **edar = BLI_array_alloca(edar, source_face->len);
        BMLoop *source_loop, *target_loop;
        BMFace *target_face = NULL;
        BMIter iter, iter2;
@@ -190,11 +192,6 @@ static void bmo_mesh_copy(BMOperator *op, BMesh *bm_src, BMesh *bm_dst)
        BMVert *v = NULL, *v2;
        BMEdge *e = NULL;
        BMFace *f = NULL;
-
-       BLI_array_declare(vtar);
-       BLI_array_declare(edar);
-       BMVert **vtar = NULL;
-       BMEdge **edar = NULL;
        
        BMIter viter, eiter, fiter;
        GHash *vhash, *ehash;
@@ -280,14 +277,7 @@ static void bmo_mesh_copy(BMOperator *op, BMesh *bm_src, BMesh *bm_dst)
                                }
                        }
 
-                       /* ensure arrays are the right size */
-                       BLI_array_empty(vtar);
-                       BLI_array_empty(edar);
-
-                       BLI_array_grow_items(vtar, f->len);
-                       BLI_array_grow_items(edar, f->len);
-
-                       copy_face(op, slot_face_map_out, bm_src, f, bm_dst, vtar, edar, vhash, ehash);
+                       copy_face(op, slot_face_map_out, bm_src, f, bm_dst, vhash, ehash);
                        BMO_elem_flag_enable(bm_src, f, DUPE_DONE);
                }
        }
@@ -295,9 +285,6 @@ static void bmo_mesh_copy(BMOperator *op, BMesh *bm_src, BMesh *bm_dst)
        /* free pointer hashes */
        BLI_ghash_free(vhash, NULL, NULL);
        BLI_ghash_free(ehash, NULL, NULL);
-
-       BLI_array_free(vtar); /* free vert pointer array */
-       BLI_array_free(edar); /* free edge pointer array */
 }
 
 /**
index 32c8ee50e05d854f3c8f24bde7748d460b0a9d5b..070cc187045410515c9b803b8073a37c2c6bbe48 100644 (file)
@@ -31,7 +31,6 @@
 #include "DNA_meshdata_types.h"
 
 #include "BLI_math.h"
-#include "BLI_array.h"
 #include "BLI_buffer.h"
 
 #include "BKE_customdata.h"
@@ -54,84 +53,42 @@ enum {
 
 void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op)
 {
-       BMVert **verts = NULL;
-       BLI_array_declare(verts);
-       BMEdge **edges = NULL;
-       BLI_array_declare(edges);
-
        BMOIter siter;
-       BMIter liter, liter2;
-       BMFace *f, *f2, *f3;
-       BMLoop *l, *l2, *l3, *l4, *l_tmp;
-       BMEdge *e, *laste;
-       BMVert *v, *lastv, *firstv;
-       int i;
+       BMFace *f_org;
 
-       BMO_ITER (f, &siter, op->slots_in, "faces", BM_FACE) {
-               BLI_array_empty(verts);
-               BLI_array_empty(edges);
-               BLI_array_grow_items(verts, f->len);
-               BLI_array_grow_items(edges, f->len);
-
-               i = 0;
-               firstv = lastv = NULL;
-               BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
-                       v = BM_vert_create(bm, l->v->co, l->v, 0);
-                       /* skip on the first iteration */
-                       if (lastv) {
-                               e = BM_edge_create(bm, lastv, v, l->e, 0);
-                               edges[i] = e;
-                               verts[i] = lastv;
-                               i++;
-                       }
+       BMO_ITER (f_org, &siter, op->slots_in, "faces", BM_FACE) {
+               BMFace *f_new;
+               BMLoop *l_org, *l_org_first;
+               BMLoop *l_new;
 
-                       lastv = v;
-                       laste = l->e;
-                       if (!firstv) firstv = v;
-               }
+               BMO_elem_flag_enable(bm, f_org, EXT_DEL);
 
-               /* this fits in the array because we skip one in the loop above */
-               e = BM_edge_create(bm, v, firstv, laste, 0);
-               edges[i] = e;
-               verts[i] = lastv;
-               i++;
+               f_new = BM_face_copy(bm, bm, f_org, true, true);
+               BMO_elem_flag_enable(bm, f_new, EXT_KEEP);
 
-               BMO_elem_flag_enable(bm, f, EXT_DEL);
+               l_org = l_org_first = BM_FACE_FIRST_LOOP(f_org);
+               l_new = BM_FACE_FIRST_LOOP(f_new);
 
-               f2 = BM_face_create(bm, verts, edges, f->len, 0);
-               if (UNLIKELY(f2 == NULL)) {
-                       BMO_error_raise(bm, op, BMERR_MESH_ERROR, "Extrude failed: could not create face");
-                       BLI_array_free(edges);
-                       return;
-               }
-               
-               BMO_elem_flag_enable(bm, f2, EXT_KEEP);
-               BM_elem_attrs_copy(bm, bm, f, f2);
-
-               l2 = BM_iter_new(&liter2, bm, BM_LOOPS_OF_FACE, f2);
-               BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
-                       BM_elem_attrs_copy(bm, bm, l, l2);
-
-                       l3 = l->next;
-                       l4 = l2->next;
+               do {
+                       BMFace *f_side;
+                       BMLoop *l_side_iter;
 
-                       f3 = BM_face_create_quad_tri(bm, l3->v, l4->v, l2->v, l->v, f, false);
-                       /* XXX, no error check here, why? - Campbell */
+                       BM_elem_attrs_copy(bm, bm, l_org, l_new);
 
-                       l_tmp = BM_FACE_FIRST_LOOP(f3);
+                       f_side = BM_face_create_quad_tri(bm,
+                                                        l_org->next->v, l_new->next->v, l_new->v, l_org->v,
+                                                        f_org, false);
 
-                       BM_elem_attrs_copy(bm, bm, l->next, l_tmp);  l_tmp = l_tmp->next;
-                       BM_elem_attrs_copy(bm, bm, l->next, l_tmp);  l_tmp = l_tmp->next;
-                       BM_elem_attrs_copy(bm, bm, l, l_tmp);        l_tmp = l_tmp->next;
-                       BM_elem_attrs_copy(bm, bm, l, l_tmp);
+                       l_side_iter = BM_FACE_FIRST_LOOP(f_side);
 
-                       l2 = BM_iter_step(&liter2);
-               }
+                       BM_elem_attrs_copy(bm, bm, l_org->next, l_side_iter);  l_side_iter = l_side_iter->next;
+                       BM_elem_attrs_copy(bm, bm, l_org->next, l_side_iter);  l_side_iter = l_side_iter->next;
+                       BM_elem_attrs_copy(bm, bm, l_org, l_side_iter);        l_side_iter = l_side_iter->next;
+                       BM_elem_attrs_copy(bm, bm, l_org, l_side_iter);
+               } while (((l_new = l_new->next),
+                         (l_org = l_org->next)) != l_org_first);
        }
 
-       BLI_array_free(verts);
-       BLI_array_free(edges);
-
        BMO_op_callf(bm, op->flag,
                     "delete geom=%ff context=%i",
                     EXT_DEL, DEL_ONLYFACES);
index b4b37f7d0bd72f08a4d346dc3a63717295101fa3..1e0f02440721bbc06eda12039dd4c53935f67537 100644 (file)
@@ -315,7 +315,8 @@ bool MeshImporter::primitive_has_faces(COLLADAFW::MeshPrimitive *mp) {
                case COLLADAFW::MeshPrimitive::TRIANGLES:
                case COLLADAFW::MeshPrimitive::TRIANGLE_FANS:
                case COLLADAFW::MeshPrimitive::POLYLIST:
-               case COLLADAFW::MeshPrimitive::POLYGONS: {
+               case COLLADAFW::MeshPrimitive::POLYGONS:
+               {
                        has_faces = true;
                        break;
                }
@@ -347,8 +348,8 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
                        case COLLADAFW::MeshPrimitive::TRIANGLES:
                        case COLLADAFW::MeshPrimitive::TRIANGLE_FANS:
                        case COLLADAFW::MeshPrimitive::POLYLIST:
-                       case COLLADAFW::MeshPrimitive::POLYGONS: {
-
+                       case COLLADAFW::MeshPrimitive::POLYGONS:
+                       {
                                COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp;
                                size_t prim_poly_count    = mpvc->getFaceCount();
 
@@ -361,7 +362,8 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
                                total_loop_count += prim_loop_count;
                                break;
                        }
-                       default: break;
+                       default:
+                               break;
                }
        }
 
@@ -400,16 +402,19 @@ unsigned int MeshImporter::get_vertex_count(COLLADAFW::Polygons *mp, int index)
        int result;
        switch (type) {
                case COLLADAFW::MeshPrimitive::TRIANGLES:
-               case COLLADAFW::MeshPrimitive::TRIANGLE_FANS: {
+               case COLLADAFW::MeshPrimitive::TRIANGLE_FANS:
+               {
                        result = 3;
                        break;
                }
                case COLLADAFW::MeshPrimitive::POLYLIST:
-               case COLLADAFW::MeshPrimitive::POLYGONS: {
+               case COLLADAFW::MeshPrimitive::POLYGONS:
+               {
                        result = mp->getGroupedVerticesVertexCountArray()[index];
                        break;
                }
-               default: {
+               default:
+               {
                        result = -1;
                        break;
                }
@@ -427,12 +432,14 @@ unsigned int MeshImporter::get_loose_edge_count(COLLADAFW::Mesh *mesh) {
                COLLADAFW::MeshPrimitive *mp = prim_arr[i];
                int type = mp->getPrimitiveType();
                switch (type) {
-                       case COLLADAFW::MeshPrimitive::LINES: {
+                       case COLLADAFW::MeshPrimitive::LINES:
+                       {
                                size_t prim_totface = mp->getFaceCount();
                                loose_edge_count += prim_totface;
                                break;
                        }
-                       default: break;
+                       default:
+                               break;
                }
        }
        return loose_edge_count;
index b088139262c4ac884e908aa9ccac05c554613642..c3665a33ca4aa36def4d6f55ee2dc736f126ca39 100644 (file)
@@ -107,15 +107,18 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob, B
        converter.mat4_to_dae_double(d_obmat, f_obmat);
 
        switch (transformation_type) {
-               case BC_TRANSFORMATION_TYPE_MATRIX     : {
+               case BC_TRANSFORMATION_TYPE_MATRIX:
+               {
                        node.addMatrix("transform",d_obmat);
                        break;
                }
-               case BC_TRANSFORMATION_TYPE_BOTH       : {
+               case BC_TRANSFORMATION_TYPE_BOTH:
+               {
                        node.addMatrix("transform",d_obmat);
-                       /* intentional fall-through */
+                       /* fall-through */
                }
-               case BC_TRANSFORMATION_TYPE_TRANSROTLOC: {
+               case BC_TRANSFORMATION_TYPE_TRANSROTLOC:
+               {
                        float loc[3], rot[3], scale[3];
                        TransformBase::decompose(f_obmat, loc, rot, NULL, scale);
                        add_transform(node, loc, rot, scale); 
index 41f48a757c0f671981e587912929cffa50f99c0e..d4196bacf0d1487320d73fb1f7ed57592d693f16 100644 (file)
@@ -145,11 +145,13 @@ Mesh *bc_get_mesh_copy(Scene *scene, Object *ob, BC_export_mesh_type export_mesh
        DerivedMesh *dm = NULL;
        if (apply_modifiers) {
                switch (export_mesh_type) {
-                       case BC_MESH_TYPE_VIEW: {
+                       case BC_MESH_TYPE_VIEW:
+                       {
                                dm = mesh_create_derived_view(scene, ob, mask);
                                break;
                        }
-                       case BC_MESH_TYPE_RENDER: {
+                       case BC_MESH_TYPE_RENDER:
+                       {
                                dm = mesh_create_derived_render(scene, ob, mask);
                                break;
                        }
index e82bf2e21c81cecff3cd6cdcffb1b3106981840f..51eaffaa31cecd612acc7efd488c5fee9417b8ca 100644 (file)
@@ -288,8 +288,8 @@ void ExecutionGroup::execute(ExecutionSystem *graph)
 
                        delete hotspots[0];
                        MEM_freeN(chunkOrders);
+                       break;
                }
-               break;
                case COM_TO_RULE_OF_THIRDS:
                {
                        ChunkOrderHotspot *hotspots[9];
@@ -336,8 +336,8 @@ void ExecutionGroup::execute(ExecutionSystem *graph)
                        delete hotspots[7];
                        delete hotspots[8];
                        MEM_freeN(chunkOrders);
+                       break;
                }
-               break;
                case COM_TO_TOP_DOWN:
                default:
                        break;
index 85554d7a7aa29d3a0d8931d21365e340acadca3e..7c0499dc04eac7ae5d8b4a6e18c1cdd782bdf2a4 100644 (file)
@@ -183,14 +183,16 @@ void GroupNode::addDefaultOutputOperation(ExecutionSystem &system, OutputSocket
        
        NodeOperation *operation = NULL;
        switch (iosock->typeinfo->type) {
-               case SOCK_FLOAT: {
+               case SOCK_FLOAT:
+               {
                        float value = RNA_float_get(&ptr, "default_value");
                        SetValueOperation *value_op = new SetValueOperation();
                        value_op->setValue(value);
                        operation = value_op;
                        break;
                }
-               case SOCK_VECTOR: {
+               case SOCK_VECTOR:
+               {
                        float vector[3];
                        RNA_float_get_array(&ptr, "default_value", vector);
                        SetVectorOperation *vector_op = new SetVectorOperation();
@@ -198,7 +200,8 @@ void GroupNode::addDefaultOutputOperation(ExecutionSystem &system, OutputSocket
                        operation = vector_op;
                        break;
                }
-               case SOCK_RGBA: {
+               case SOCK_RGBA:
+               {
                        float color[4];
                        RNA_float_get_array(&ptr, "default_value", color);
                        SetColorOperation *color_op = new SetColorOperation();
index a441dce565608e692e59a653edcd3aa51ea440b1..b2c63addb879d8a7cbe5f0029f4536222b556902 100644 (file)
@@ -2921,9 +2921,8 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting
                                                return ((*val) & flag) == 0;
                                        else
                                                return ((*val) & flag) != 0;
+                                       break;
                                }
-                               break;
-                                       
                                case sizeof(short): /* short pointer for setting */
                                {
                                        short *val = (short *)ptr;
@@ -2932,9 +2931,8 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting
                                                return ((*val) & flag) == 0;
                                        else
                                                return ((*val) & flag) != 0;
+                                       break;
                                }
-                               break;
-                                       
                                case sizeof(char):  /* char pointer for setting */
                                {
                                        char *val = (char *)ptr;
@@ -2943,8 +2941,8 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting
                                                return ((*val) & flag) == 0;
                                        else
                                                return ((*val) & flag) != 0;
+                                       break;
                                }
-                               break;
                        }
                }
        }
@@ -2994,22 +2992,20 @@ void ANIM_channel_setting_set(bAnimContext *ac, bAnimListElem *ale, int setting,
                                {
                                        int *val = (int *)ptr;
                                        ACF_SETTING_SET(*val, flag, mode);
+                                       break;
                                }
-                               break;
-                                       
                                case sizeof(short): /* short pointer for setting */
                                {
                                        short *val = (short *)ptr;
                                        ACF_SETTING_SET(*val, flag, mode);
+                                       break;
                                }
-                               break;
-                                       
                                case sizeof(char):  /* char pointer for setting */
                                {
                                        char *val = (char *)ptr;
                                        ACF_SETTING_SET(*val, flag, mode);
+                                       break;
                                }
-                               break;
                        }
                }
        }
@@ -3156,14 +3152,14 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float
                                {
                                        SpaceAction *saction = (SpaceAction *)ac->sl;
                                        draw_sliders = (saction->flag & SACTION_SLIDERS);
+                                       break;
                                }
-                               break;
                                case SPACE_IPO:
                                {
                                        SpaceIpo *sipo = (SpaceIpo *)ac->sl;
                                        draw_sliders = (sipo->flag & SIPO_SLIDERS);
+                                       break;
                                }
-                               break;
                        }
                }
 
@@ -3546,14 +3542,14 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale
                                {
                                        SpaceAction *saction = (SpaceAction *)ac->sl;
                                        draw_sliders = (saction->flag & SACTION_SLIDERS);
+                                       break;
                                }
-                               break;
                                case SPACE_IPO:
                                {
                                        SpaceIpo *sipo = (SpaceIpo *)ac->sl;
                                        draw_sliders = (sipo->flag & SIPO_SLIDERS);
+                                       break;
                                }
-                               break;
                        }
                }
                
index 481430f37e487b7f9dd6d730c4617b96502517fe..59ae45e446a0eef7df671f9dd2eab80771384cbb 100644 (file)
@@ -94,23 +94,22 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
                                bActionGroup *agrp = (bActionGroup *)ale->data;
                                
                                ACHANNEL_SET_FLAG(agrp, ACHANNEL_SETFLAG_CLEAR, AGRP_ACTIVE);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_FCURVE:
                        {
                                FCurve *fcu = (FCurve *)ale->data;
                                
                                ACHANNEL_SET_FLAG(fcu, ACHANNEL_SETFLAG_CLEAR, FCURVE_ACTIVE);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_NLATRACK:
                        {
                                NlaTrack *nlt = (NlaTrack *)ale->data;
                                
                                ACHANNEL_SET_FLAG(nlt, ACHANNEL_SETFLAG_CLEAR, NLATRACK_ACTIVE);
+                               break;
                        }
-                       break;
-                       
                        case ANIMTYPE_FILLACTD: /* Action Expander */
                        case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
                        case ANIMTYPE_DSLAM:
@@ -131,8 +130,8 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
                                if (ale->adt) {
                                        ACHANNEL_SET_FLAG(ale->adt, ACHANNEL_SETFLAG_CLEAR, ADT_UI_ACTIVE);
                                }
+                               break;
                        }
-                       break;
                }
        }
        
@@ -143,21 +142,20 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
                        {
                                bActionGroup *agrp = (bActionGroup *)channel_data;
                                agrp->flag |= AGRP_ACTIVE;
+                               break;
                        }
-                       break;
                        case ANIMTYPE_FCURVE:
                        {
                                FCurve *fcu = (FCurve *)channel_data;
                                fcu->flag |= FCURVE_ACTIVE;
+                               break;
                        }
-                       break;
                        case ANIMTYPE_NLATRACK:
                        {
                                NlaTrack *nlt = (NlaTrack *)channel_data;
                                nlt->flag |= NLATRACK_ACTIVE;
+                               break;
                        }
-                       break;
-                               
                        case ANIMTYPE_FILLACTD: /* Action Expander */
                        case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
                        case ANIMTYPE_DSLAM:
@@ -177,8 +175,8 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
                                if (ale && ale->adt) {
                                        ale->adt->flag |= ADT_UI_ACTIVE;
                                }
+                               break;
                        }
-                       break;
                }
        }
        
@@ -256,9 +254,8 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
                                {
                                        if ((ale->adt) && (ale->adt->flag & ADT_UI_SELECTED))
                                                sel = ACHANNEL_SETFLAG_CLEAR;
+                                       break;
                                }
-                               break;
-                                       
                                case ANIMTYPE_GPLAYER:
                                        if (ale->flag & GP_LAYER_SELECT)
                                                sel = ACHANNEL_SETFLAG_CLEAR;
@@ -283,55 +280,54 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
                                if (scene->adt) {
                                        ACHANNEL_SET_FLAG(scene, sel, ADT_UI_SELECTED);
                                }
+                               break;
                        }
-                       break;
                        case ANIMTYPE_OBJECT:
+                       {
                        #if 0   /* for now, do not take object selection into account, since it gets too annoying */
-                               {
-                                       Base *base = (Base *)ale->data;
-                                       Object *ob = base->object;
-                                       
-                                       ACHANNEL_SET_FLAG(base, sel, SELECT);
-                                       ACHANNEL_SET_FLAG(ob, sel, SELECT);
-                                       
-                                       if (ob->adt) {
-                                               ACHANNEL_SET_FLAG(ob, sel, ADT_UI_SELECTED);
-                                       }
+                               Base *base = (Base *)ale->data;
+                               Object *ob = base->object;
+
+                               ACHANNEL_SET_FLAG(base, sel, SELECT);
+                               ACHANNEL_SET_FLAG(ob, sel, SELECT);
+
+                               if (ob->adt) {
+                                       ACHANNEL_SET_FLAG(ob, sel, ADT_UI_SELECTED);
                                }
                        #endif
                                break;
+                       }
                        case ANIMTYPE_GROUP:
                        {
                                bActionGroup *agrp = (bActionGroup *)ale->data;
                                
                                ACHANNEL_SET_FLAG(agrp, sel, AGRP_SELECTED);
                                agrp->flag &= ~AGRP_ACTIVE;
+                               break;
                        }
-                       break;
                        case ANIMTYPE_FCURVE:
                        {
                                FCurve *fcu = (FCurve *)ale->data;
                                
                                ACHANNEL_SET_FLAG(fcu, sel, FCURVE_SELECTED);
                                fcu->flag &= ~FCURVE_ACTIVE;
+                               break;
                        }
-                       break;
                        case ANIMTYPE_SHAPEKEY:
                        {
                                KeyBlock *kb = (KeyBlock *)ale->data;
                                
                                ACHANNEL_SET_FLAG(kb, sel, KEYBLOCK_SEL);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_NLATRACK:
                        {
                                NlaTrack *nlt = (NlaTrack *)ale->data;
                                
                                ACHANNEL_SET_FLAG(nlt, sel, NLATRACK_SELECTED);
                                nlt->flag &= ~NLATRACK_ACTIVE;
+                               break;
                        }
-                       break;
-                               
                        case ANIMTYPE_FILLACTD: /* Action Expander */
                        case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
                        case ANIMTYPE_DSLAM:
@@ -354,24 +350,22 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
                                        ACHANNEL_SET_FLAG(ale->adt, sel, ADT_UI_SELECTED);
                                        ale->adt->flag &= ~ADT_UI_ACTIVE;
                                }
+                               break;
                        }
-                       break;
-                               
                        case ANIMTYPE_GPLAYER:
                        {
                                bGPDlayer *gpl = (bGPDlayer *)ale->data;
                                
                                ACHANNEL_SET_FLAG(gpl, sel, GP_LAYER_SELECT);
+                               break;
                        }
-                       break;
-                       
                        case ANIMTYPE_MASKLAYER:
                        {
                                MaskLayer *masklay = (MaskLayer *)ale->data;
                                
                                ACHANNEL_SET_FLAG(masklay, sel, MASK_LAYERFLAG_SELECT);
+                               break;
                        }
-                       break;
                }
        }
        
@@ -801,23 +795,22 @@ static void rearrange_animchannel_add_to_islands(ListBase *islands, ListBase *sr
                        
                        is_sel = SEL_AGRP(agrp);
                        is_untouchable = (agrp->flag & AGRP_TEMP) != 0;
+                       break;
                }
-               break;
                case ANIMTYPE_FCURVE:
                {
                        FCurve *fcu = (FCurve *)channel;
                        
                        is_sel = SEL_FCU(fcu);
+                       break;
                }
-               break;
                case ANIMTYPE_NLATRACK:
                {
                        NlaTrack *nlt = (NlaTrack *)channel;
                        
                        is_sel = SEL_NLT(nlt);
+                       break;
                }
-               break;
-                       
                default:
                        printf("rearrange_animchannel_add_to_islands(): don't know how to handle channels of type %d\n", type);
                        return;
@@ -1435,9 +1428,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
                                
                                /* try to free F-Curve */
                                ANIM_fcurve_delete_from_animdata(&ac, adt, fcu);
+                               break;
                        }
-                       break;
-                               
                        case ANIMTYPE_GPLAYER:
                        {
                                /* Grease Pencil layer */
@@ -1447,9 +1439,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
                                /* try to delete the layer's data and the layer itself */
                                free_gpencil_frames(gpl);
                                BLI_freelinkN(&gpd->layers, gpl);
+                               break;
                        }
-                       break;
-                       
                        case ANIMTYPE_MASKLAYER:
                        {
                                /* Mask layer */
@@ -1458,8 +1449,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
                                
                                /* try to delete the layer's data and the layer itself */
                                BKE_mask_layer_remove(mask, masklay);
+                               break;
                        }
-                       break;
                }
        }
        
@@ -2131,8 +2122,8 @@ static void borderselect_anim_channels(bAnimContext *ac, rcti *rect, short selec
                                        
                                        /* always clear active flag after doing this */
                                        agrp->flag &= ~AGRP_ACTIVE;
+                                       break;
                                }
-                               break;
                                case ANIMTYPE_NLATRACK:
                                {
                                        NlaTrack *nlt = (NlaTrack *)ale->data;
@@ -2141,8 +2132,8 @@ static void borderselect_anim_channels(bAnimContext *ac, rcti *rect, short selec
                                         * currently adds complications when doing other stuff 
                                         */
                                        ACHANNEL_SET_FLAG(nlt, selectmode, NLATRACK_SELECTED);
+                                       break;
                                }
-                               break;
                        }
                }
                
@@ -2367,8 +2358,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
                        }
                        
                        notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
+                       break;
                }
-               break;
                case ANIMTYPE_OBJECT:
                {
                        bDopeSheet *ads = (bDopeSheet *)ac->data;
@@ -2406,9 +2397,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
                                adt->flag |= ADT_UI_ACTIVE;
                        
                        notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
+                       break;
                }
-               break;
-               
                case ANIMTYPE_FILLACTD: /* Action Expander */
                case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
                case ANIMTYPE_DSLAM:
@@ -2445,9 +2435,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
                        }
                        
                        notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
+                       break;
                }
-               break;
-               
                case ANIMTYPE_GROUP: 
                {
                        bActionGroup *agrp = (bActionGroup *)ale->data;
@@ -2482,8 +2471,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
                                ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, NULL, ANIMTYPE_GROUP);
                                
                        notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
+                       break;
                }
-               break;
                case ANIMTYPE_FCURVE: 
                {
                        FCurve *fcu = (FCurve *)ale->data;
@@ -2504,8 +2493,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
                                ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
                                
                        notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
+                       break;
                }
-               break;
                case ANIMTYPE_SHAPEKEY: 
                {
                        KeyBlock *kb = (KeyBlock *)ale->data;
@@ -2522,8 +2511,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
                        }
                                
                        notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
+                       break;
                }
-               break;
                case ANIMTYPE_GPDATABLOCK:
                {
                        bGPdata *gpd = (bGPdata *)ale->data;
@@ -2534,8 +2523,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
                        gpd->flag ^= GP_DATA_EXPAND;
                        
                        notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
+                       break;
                }
-               break;
                case ANIMTYPE_GPLAYER:
                {
                        bGPDlayer *gpl = (bGPDlayer *)ale->data;
@@ -2552,8 +2541,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
                        }
                        
                        notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
+                       break;
                }
-               break;
                case ANIMTYPE_MASKDATABLOCK:
                {
                        Mask *mask = (Mask *)ale->data;
@@ -2564,8 +2553,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
                        mask->flag ^= MASK_ANIMF_EXPAND;
                        
                        notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
+                       break;
                }
-               break;
                case ANIMTYPE_MASKLAYER:
                {
                        MaskLayer *masklay = (MaskLayer *)ale->data;
@@ -2582,8 +2571,8 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in
                        }
                        
                        notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
+                       break;
                }
-               break;
                default:
                        if (G.debug & G_DEBUG)
                                printf("Error: Invalid channel type in mouse_anim_channels()\n");
index 2e580a57a0110f3afecf1eb840692258c94cdf76..9e8800fd91e9391ba32a814b64b9ec4009277f17 100644 (file)
@@ -126,17 +126,15 @@ void ANIM_timecode_string_from_frame(char *str, Scene *scene, int power, short t
                                        if (hours) sprintf(str, "%s%02d:%02d:%02d", neg, hours, minutes, seconds);
                                        else sprintf(str, "%s%02d:%02d", neg, minutes, seconds);
                                }
+                               break;
                        }
-                       break;
-                               
                        case USER_TIMECODE_SMPTE_MSF:
                        {
                                /* reduced SMPTE format that always shows minutes, seconds, frames. Hours only shown as needed. */
                                if (hours) sprintf(str, "%s%02d:%02d:%02d:%02d", neg, hours, minutes, seconds, frames);
                                else sprintf(str, "%s%02d:%02d:%02d", neg, minutes, seconds, frames);
+                               break;
                        }
-                       break;
-                       
                        case USER_TIMECODE_MILLISECONDS:
                        {
                                /* reduced SMPTE. Instead of frames, milliseconds are shown */
@@ -145,25 +143,23 @@ void ANIM_timecode_string_from_frame(char *str, Scene *scene, int power, short t
                                
                                if (hours) sprintf(str, "%s%02d:%02d:%0*.*f", neg, hours, minutes, s_pad, ms_dp, cfra);
                                else sprintf(str, "%s%02d:%0*.*f", neg, minutes, s_pad,  ms_dp, cfra);
+                               break;
                        }
-                       break;
-                               
                        case USER_TIMECODE_SECONDS_ONLY:
                        {
                                /* only show the original seconds display */
                                /* round to whole numbers if power is >= 1 (i.e. scale is coarse) */
                                if (power <= 0) sprintf(str, "%.*f", 1 - power, raw_seconds);
                                else sprintf(str, "%d", (int)floor(raw_seconds + GLA_PIXEL_OFS));
+                               break;
                        }
-                       break;
-                       
                        case USER_TIMECODE_SMPTE_FULL:
                        default:
                        {
                                /* full SMPTE format */
                                sprintf(str, "%s%02d:%02d:%02d:%02d", neg, hours, minutes, seconds, frames);
+                               break;
                        }
-                       break;
                }
        }
        else {
index 41aeb92e182daf955a116bedbcadf475e909b576..910036745240d7171243a3e6c0d8fdfcf518d431 100644 (file)
@@ -301,22 +301,20 @@ short ANIM_animdata_context_getdata(bAnimContext *ac)
                        {
                                SpaceAction *saction = (SpaceAction *)sl;
                                ok = actedit_get_context(ac, saction);
+                               break;
                        }
-                       break;
-                               
                        case SPACE_IPO:
                        {
                                SpaceIpo *sipo = (SpaceIpo *)sl;
                                ok = graphedit_get_context(ac, sipo);
+                               break;
                        }
-                       break;
-                               
                        case SPACE_NLA:
                        {
                                SpaceNla *snla = (SpaceNla *)sl;
                                ok = nlaedit_get_context(ac, snla);
+                               break;
                        }
-                       break;
                }
        }
        
@@ -543,9 +541,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                 */
                                ale->key_data = NULL;
                                ale->datatype = ALE_ALL;
+                               break;
                        }
-                       break;
-                       
                        case ANIMTYPE_SCENE:
                        {
                                Scene *sce = (Scene *)data;
@@ -556,8 +553,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_SCE;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_OBJECT:
                        {
                                Base *base = (Base *)data;
@@ -569,8 +566,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_OB;
                                
                                ale->adt = BKE_animdata_from_id(&ob->id);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_FILLACTD:
                        {
                                bAction *act = (bAction *)data;
@@ -579,8 +576,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                
                                ale->key_data = act;
                                ale->datatype = ALE_ACT;
+                               break;
                        }
-                       break;
                        case ANIMTYPE_FILLDRIVERS:
                        {
                                AnimData *adt = (AnimData *)data;
@@ -590,9 +587,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                // XXX... drivers don't show summary for now
                                ale->key_data = NULL;
                                ale->datatype = ALE_NONE;
+                               break;
                        }
-                       break;
-                       
                        case ANIMTYPE_DSMAT:
                        {
                                Material *ma = (Material *)data;
@@ -604,8 +600,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSLAM:
                        {
                                Lamp *la = (Lamp *)data;
@@ -617,8 +613,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSCAM:
                        {
                                Camera *ca = (Camera *)data;
@@ -630,8 +626,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSCUR:
                        {
                                Curve *cu = (Curve *)data;
@@ -643,8 +639,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSARM:
                        {
                                bArmature *arm = (bArmature *)data;
@@ -656,8 +652,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSMESH:
                        {
                                Mesh *me = (Mesh *)data;
@@ -669,8 +665,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSLAT:
                        {
                                Lattice *lt = (Lattice *)data;
@@ -682,8 +678,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSSPK:
                        {
                                Speaker *spk = (Speaker *)data;
@@ -695,8 +691,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSSKEY:
                        {
                                Key *key = (Key *)data;
@@ -708,8 +704,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSWOR:
                        {
                                World *wo = (World *)data;
@@ -721,8 +717,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSNTREE:
                        {
                                bNodeTree *ntree = (bNodeTree *)data;
@@ -734,8 +730,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSLINESTYLE:
                        {
                                FreestyleLineStyle *linestyle = (FreestyleLineStyle *)data;
@@ -747,8 +743,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSPART:
                        {
                                ParticleSettings *part = (ParticleSettings *)ale->data;
@@ -760,8 +756,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
                        case ANIMTYPE_DSTEX:
                        {
                                Tex *tex = (Tex *)data;
@@ -773,9 +769,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                ale->datatype = ALE_ACT;
                                
                                ale->adt = BKE_animdata_from_id(data);
+                               break;
                        }
-                       break;
-                               
                        case ANIMTYPE_GROUP:
                        {
                                bActionGroup *agrp = (bActionGroup *)data;
@@ -784,8 +779,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                
                                ale->key_data = NULL;
                                ale->datatype = ALE_GROUP;
+                               break;
                        }
-                       break;
                        case ANIMTYPE_FCURVE:
                        {
                                FCurve *fcu = (FCurve *)data;
@@ -794,9 +789,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                
                                ale->key_data = fcu;
                                ale->datatype = ALE_FCURVE;
+                    &