Merged changes from trunk r58324-58419. ge_dev
authorMitchell Stokes <mogurijin@gmail.com>
Fri, 19 Jul 2013 22:10:11 +0000 (22:10 +0000)
committerMitchell Stokes <mogurijin@gmail.com>
Fri, 19 Jul 2013 22:10:11 +0000 (22:10 +0000)
144 files changed:
CMakeLists.txt
intern/cycles/blender/blender_sync.cpp
intern/cycles/kernel/kernel_light.h
intern/cycles/render/session.cpp
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
intern/opencl/OCL_opencl.h
intern/opencl/intern/OCL_opencl.c
intern/opencl/intern/clew.c
release/datafiles/LICENSE-droidsans.ttf.txt
release/datafiles/fonts/droidsans.ttf.gz
release/datafiles/splash.png
release/scripts/startup/bl_operators/node.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_fcurve.h
source/blender/blenkernel/BKE_key.h
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/curve.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/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_ghash.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/ArmatureImporter.cpp
source/blender/collada/ControllerExporter.cpp
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/intern/COM_WorkScheduler.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.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mesh/editmesh_loopcut.c
source/blender/editors/mesh/editmesh_select.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_opengl.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/space_action/action_draw.c
source/blender/editors/space_action/action_edit.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/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_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_constraints.c
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/cineon/logImageCore.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/makesdna/DNA_curve_types.h
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_object.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_wm_api.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/Expressions/KX_HashedPtr.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_IPO_SGController.cpp

index d3c65baec345eb66e54213195f50552f69c9e877..e91ec18caee7fddd150d7603b6ae7655853c1603 100644 (file)
@@ -1964,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")
@@ -1990,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 72ed1b84915b4ebf0289b2bc3e79891ad0e7d650..e9e39e485f5a46c7b07da819e8c884fa2f530ed6 100644 (file)
@@ -392,7 +392,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
                else {
                        params.samples = get_int(cscene, "preview_aa_samples");
                        if(params.samples == 0)
-                               params.samples = INT_MAX;
+                               params.samples = 65536;
                }
        }
        else {
@@ -402,7 +402,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
                else {
                        params.samples = get_int(cscene, "preview_samples");
                        if(params.samples == 0)
-                               params.samples = INT_MAX;
+                               params.samples = 65536;
                }
        }
 
index 4983122fb346b2f2a11dcd5042b6f98be99528c7..5091eac41db6f4a34ee93de0fa11129161a2f767 100644 (file)
@@ -271,7 +271,7 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp,
                        ls->pdf = invarea;
 
                        if(type == LIGHT_SPOT) {
-                               /* spot light attentuation */
+                               /* spot light attenuation */
                                float4 data2 = kernel_tex_fetch(__light_data, lamp*LIGHT_SIZE + 2);
                                ls->eval_fac *= spot_light_attenuation(data1, data2, ls);
                        }
index d13e86429d6f2bf3878f3891239accb837ef2510..9ff2b91e25e4a9b7be538b4dcee155a3a0cc8bf7 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 == 65536)
                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 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 4ee167b2fb43af597666fe86cc627f40009564c7..733e3527197416d16895d54761db44ad609556cf 100644 (file)
@@ -28,7 +28,7 @@ extern "C" {
 #endif
 
 #include "intern/clew.h"
-void OCL_init(void);
+int OCL_init(void);
 
 #ifdef __cplusplus
 }
index e3130e16bde7aae3ff833acf4c95a86f460f8083..33a936896fd7eaadd0d828238cf79c5630d75661 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "OCL_opencl.h"
 
-void OCL_init(void)
+int OCL_init(void)
 {
 #ifdef _WIN32
        const char *path = "OpenCL.dll";
@@ -32,6 +32,6 @@ void OCL_init(void)
        const char *path = "libOpenCL.so";
 #endif
 
-       clewInit(path);
+       return (clewInit(path) == CLEW_SUCCESS);
 }
 
index d68eb17288f532e8d490b273f5a562ce42658f6a..1e31ebced0a042a083daf0b7433b904eed06949e 100644 (file)
@@ -227,6 +227,11 @@ int clewInit(const char* path)
     __oclEnqueueWaitForEvents          = (PFNCLENQUEUEWAITFOREVENTS        )CLCC_DYNLIB_IMPORT(module, "clEnqueueWaitForEvents");
     __oclEnqueueBarrier                = (PFNCLENQUEUEBARRIER              )CLCC_DYNLIB_IMPORT(module, "clEnqueueBarrier");
     __oclGetExtensionFunctionAddress   = (PFNCLGETEXTENSIONFUNCTIONADDRESS )CLCC_DYNLIB_IMPORT(module, "clGetExtensionFunctionAddress");
+       
+       if(__oclGetPlatformIDs == NULL) return CLEW_ERROR_OPEN_FAILED;
+       if(__oclGetPlatformInfo == NULL) return CLEW_ERROR_OPEN_FAILED;
+       if(__oclGetDeviceIDs == NULL) return CLEW_ERROR_OPEN_FAILED;
+       if(__oclGetDeviceInfo == NULL) return CLEW_ERROR_OPEN_FAILED;
 
     return CLEW_SUCCESS;
 }
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
index cc1fa93ec2c660ca3856e7e866ea20d8e40e4d27..c70b5832bfb9e853fe240a453778a5678a070305 100644 (file)
@@ -66,8 +66,12 @@ class NodeAddOperator():
 
         # convert mouse position to the View2D for later node placement
         if context.region.type == 'WINDOW':
+            # XXX, temp fix for [#35920], still fails for (U.pixelsize != 1)
+            dpi_fac = context.user_preferences.system.dpi / 72.0
             space.cursor_location = v2d.region_to_view(event.mouse_region_x,
                                                        event.mouse_region_y)
+            space.cursor_location /= dpi_fac
+
         else:
             space.cursor_location = tree.view_center
 
index 7fe8d334572c1aa71cd17736ce4150778a980eab..2bbfd26f5f366213000768539d7ce5ca9cd122d5 100644 (file)
@@ -723,6 +723,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 +748,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'
 
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 d7ef04195d553574cad71dd726924f4d750aca44..64a6811bf519a1527351ce4017502de0d64a0c4e 100644 (file)
@@ -216,7 +216,7 @@ struct FCurve *rna_get_fcurve(struct PointerRNA *ptr, struct PropertyRNA *prop,
 int binarysearch_bezt_index(struct BezTriple array[], float frame, int arraylen, bool *r_replace);
 
 /* get the time extents for F-Curve */
-void calc_fcurve_range(struct FCurve *fcu, float *min, float *max,
+bool calc_fcurve_range(struct FCurve *fcu, float *min, float *max,
                        const short do_sel_only, const short do_min_length);
 
 /* get the bounding-box extents for F-Curve */
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 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 8fae35864390a21d3324c789f3a5d6c4f17535e9..2ede5acd6e94d58843e79a65a98a0f86c9097dd9 100644 (file)
@@ -2100,8 +2100,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' */
@@ -2123,8 +2123,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 7f6dc680a7468172e4150a2f3781c5e3e029fe7e..faa4d8d3071dac29c2a45f4f049ed0ec95d6b4e5 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 c78038c0f6673a7acfd92628a1fb562eea0b4510..b8d851d082ac15b077b74de576a38c44f343223a 100644 (file)
@@ -132,8 +132,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 */
@@ -158,9 +158,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);
@@ -195,8 +194,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 */
@@ -207,8 +206,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 */
@@ -246,8 +245,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 */
@@ -267,8 +266,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 */
@@ -282,8 +281,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 */
@@ -297,8 +296,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 {
@@ -2235,8 +2234,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 */
@@ -2249,8 +2248,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 */
@@ -2264,8 +2263,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 */
@@ -2279,16 +2278,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) {
@@ -2304,8 +2303,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 */
@@ -2318,8 +2317,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 */
@@ -2333,8 +2332,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 */
@@ -2348,16 +2347,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) {
@@ -2373,8 +2372,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 */
@@ -2387,8 +2386,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 */
@@ -2402,8 +2401,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 */
@@ -2417,21 +2416,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);
@@ -4414,8 +4413,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;
@@ -4640,8 +4639,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 :/ */
@@ -4654,8 +4653,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 3b9fbbb1c4d98948dfbb57ee9ff707250fbc7089..00a479b8b880364073059cd53774ce9df3eea771 100644 (file)
@@ -2323,6 +2323,7 @@ void BKE_curve_bevelList_make(Object *ob)
                        bl = MEM_callocN(sizeof(BevList) + 1 * sizeof(BevPoint), "makeBevelList1");
                        BLI_addtail(&(cu->bev), bl);
                        bl->nr = 0;
+                       bl->charidx = nu->charidx;
                }
                else {
                        if (G.is_rendering && cu->resolu_ren != 0)
@@ -2335,10 +2336,10 @@ void BKE_curve_bevelList_make(Object *ob)
                                bl = MEM_callocN(sizeof(BevList) + len * sizeof(BevPoint), "makeBevelList2");
                                BLI_addtail(&(cu->bev), bl);
 
-                               if (nu->flagu & CU_NURB_CYCLIC) bl->poly = 0;
-                               else bl->poly = -1;
+                               bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1;
                                bl->nr = len;
                                bl->dupe_nr = 0;
+                               bl->charidx = nu->charidx;
                                bevp = (BevPoint *)(bl + 1);
                                bp = nu->bp;
 
@@ -2358,8 +2359,8 @@ void BKE_curve_bevelList_make(Object *ob)
                                bl = MEM_callocN(sizeof(BevList) + len * sizeof(BevPoint), "makeBevelBPoints");
                                BLI_addtail(&(cu->bev), bl);
 
-                               if (nu->flagu & CU_NURB_CYCLIC) bl->poly = 0;
-                               else bl->poly = -1;
+                               bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1;
+                               bl->charidx = nu->charidx;
                                bevp = (BevPoint *)(bl + 1);
 
                                a = nu->pntsu - 1;
@@ -2445,8 +2446,8 @@ void BKE_curve_bevelList_make(Object *ob)
                                        BLI_addtail(&(cu->bev), bl);
                                        bl->nr = len;
                                        bl->dupe_nr = 0;
-                                       if (nu->flagu & CU_NURB_CYCLIC) bl->poly = 0;
-                                       else bl->poly = -1;
+                                       bl->poly = (nu->flagu & CU_NURB_CYCLIC) ? 0 : -1;
+                                       bl->charidx = nu->charidx;
                                        bevp = (BevPoint *)(bl + 1);
 
                                        BKE_nurb_makeCurve(nu, &bevp->vec[0],
@@ -2572,9 +2573,11 @@ void BKE_curve_bevelList_make(Object *ob)
                        bl = sd->bl;     /* is bl a hole? */
                        sd1 = sortdata + (a - 1);
                        for (b = a - 1; b >= 0; b--, sd1--) { /* all polys to the left */
-                               if (bevelinside(sd1->bl, bl)) {
-                                       bl->hole = 1 - sd1->bl->hole;
-                                       break;
+                               if (sd1->bl->charidx == bl->charidx) { /* for text, only check matching char */
+                                       if (bevelinside(sd1->bl, bl)) {
+                                               bl->hole = 1 - sd1->bl->hole;
+                                               break;
+                                       }
                                }
                        }
                }
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 8958680d611198c6f58bef5bd71853958763f071..55a312f31ba9a384e61ec3f4a2e5e71871dee515 100644 (file)
@@ -577,7 +577,7 @@ short calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, flo
 }
 
 /* Calculate the extents of F-Curve's keyframes */
-void calc_fcurve_range(FCurve *fcu, float *start, float *end,
+bool calc_fcurve_range(FCurve *fcu, float *start, float *end,
                        const short do_sel_only, const short do_min_length)
 {
        float min = 999999999.0f, max = -999999999.0f;
@@ -621,6 +621,8 @@ void calc_fcurve_range(FCurve *fcu, float *start, float *end,
 
        *start = min;
        *end = max;
+
+       return foundvert;
 }
 
 /* ----------------- Status Checks -------------------------- */
@@ -665,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;
@@ -1701,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 */
                {
@@ -1736,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
@@ -1757,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 a445d43da00f5aef9fe83a21bc88cf4fd5f43baf..e14b51975c8e19682fdde4ec44096b7d9c6b0f8a 100644 (file)
@@ -1430,8 +1430,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;
@@ -1441,8 +1441,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;
@@ -1450,8 +1450,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;
@@ -1465,8 +1465,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;
@@ -1479,8 +1479,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 f24a55dcc44dd30aeeaaa38ac0ed4607985f01ff..439965420f7352bbde6c21c840eeef4ab4285faa 100644 (file)
@@ -2189,10 +2189,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 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 e79a759407b2544f02792aee2126e9113448c7a0..1df644318244c88dacf6f2ed2246e1c92909c12b 100644 (file)
@@ -1589,13 +1589,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];
@@ -2357,8 +2359,9 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
 
                        /* Use the object bounding box so that modifier output
                         * gets taken into account */
-                       if (ob->bb)
+                       if (ob->bb) {
                                bb = *(ob->bb);
+                       }
                        else {
                                if (cu->bb == NULL)
                                        BKE_curve_texspace_calc(cu);
@@ -2370,8 +2373,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;
@@ -2387,9 +2390,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;
@@ -2408,6 +2412,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);
@@ -2421,8 +2426,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];
@@ -2721,10 +2726,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 d30d3f3d256a6a04a730e8b2e512dc8031d89b20..5b9045b1ba26a846c3efc05d61dff61c9665821b 100644 (file)
@@ -116,9 +116,14 @@ void BLI_ghash_insert(GHash *gh, void *key, void *val)
 
 void *BLI_ghash_lookup(GHash *gh, const void *key)
 {
-       const unsigned int hash = gh->hashfp(key) % gh->nbuckets;
+
+       unsigned int hash;
        Entry *e;
 
+       if (!gh) return NULL;
+
+       hash = gh->hashfp(key) % gh->nbuckets;
+
        for (e = gh->buckets[hash]; e; e = e->next) {
                if (gh->cmpfp(key, e->key) == 0) {
                        return e->val;
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 a6da0762b1c68adb60794aa1e7e99bfce71af21c..50273cb33f31a712f5d428560057cd55509bbfcd 100644 (file)
@@ -7689,31 +7689,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 0cd48707566c3d699a6a8ede2b7a2e3799b679dc..eb92b089f481dca9f93a9769f75f3babaded659c 100644 (file)
@@ -133,24 +133,28 @@ void ArmatureImporter::create_bone(SkinInfo *skin, COLLADAFW::Node *node, EditBo
        add_v3_v3v3(bone->tail, bone->head, vec);
 
        // set parent tail
-       if (parent && totchild == 1) {
-               copy_v3_v3(parent->tail, bone->head);
-
-               // not setting BONE_CONNECTED because this would lock child bone location with respect to parent
-               bone->flag |= BONE_CONNECTED;
+       if (parent) {
 
                // XXX increase this to prevent "very" small bones?
                const float epsilon = 0.000001f;
 
                // derive leaf bone length
-               float length = len_v3v3(parent->head, parent->tail);
+               float length = len_v3v3(parent->head, bone->head);
                if ((length < leaf_bone_length || totbone == 0) && length > epsilon) {
                        leaf_bone_length = length;
                }
 
-               // treat zero-sized bone like a leaf bone
-               if (length <= epsilon) {
-                       add_leaf_bone(parent_mat, parent, node);
+               if (totchild == 1) {
+                       copy_v3_v3(parent->tail, bone->head);
+
+                       // not setting BONE_CONNECTED because this would lock child bone location with respect to parent
+                       bone->flag |= BONE_CONNECTED;
+
+
+                       // treat zero-sized bone like a leaf bone
+                       if (length <= epsilon) {
+                               add_leaf_bone(parent_mat, parent, node);
+                       }
                }
 
        }
index 4c6f71ff1a6e099d8730a8e94a25a58b1878b9f4..d04ed8d6fa1f54cce007bac048b564295d1844a1 100644 (file)
@@ -123,7 +123,7 @@ void ControllerExporter::operator()(Object *ob)
        if (ob_arm) {
                export_skin_controller(ob, ob_arm);
        }
-       if (key) {
+       if (key && this->export_settings->include_shapekeys) {
                export_morph_controller(ob, key);
        }
 }
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 402fa28e210c856a1eced34cd09a1cae322dae74..e0ac767b6287e1201579f351f8db597a3bb198e0 100644 (file)
@@ -304,7 +304,8 @@ void WorkScheduler::initialize(bool use_opencl)
                g_context = NULL;
                g_program = NULL;
 
-               OCL_init(); /* this will check and skip if already initialized */
+               if (!OCL_init()) /* this will check for errors and skip if already initialized */
+                       return;
 
                if (clCreateContextFromType) {
                        cl_uint numberOfPlatforms = 0;
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;
+                               break;
                        }
-                       break;
-                               
                        case ANIMTYPE_SHAPEKEY:
                        {
                                KeyBlock *kb = (KeyBlock *)data;
@@ -824,9 +818,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                        }
                                        ale->datatype = (ale->key_data) ? ALE_FCURVE : ALE_NONE;
                                }
+                               break;
                        }
-                       break;
-                       
                        case ANIMTYPE_GPLAYER:
                        {
                                bGPDlayer *gpl = (bGPDlayer *)data;
@@ -835,9 +828,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                
                                ale->key_data = NULL;
                                ale->datatype = ALE_GPFRAME;
+                               break;
                        }
-                       break;
-                       
                        case ANIMTYPE_MASKLAYER:
                        {
                                MaskLayer *masklay = (MaskLayer *)data;
@@ -846,9 +838,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                
                                ale->key_data = NULL;
                                ale->datatype = ALE_MASKLAY;
+                               break;
                        }
-                       break;
-                       
                        case ANIMTYPE_NLATRACK:
                        {
                                NlaTrack *nlt = (NlaTrack *)data;
@@ -857,15 +848,15 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
                                
                                ale->key_data = &nlt->strips;
                                ale->datatype = ALE_NLASTRIP;
+                               break;
                        }
-                       break;
                        case ANIMTYPE_NLAACTION:
                        {
                                /* nothing to include for now... nothing editable from NLA-perspective here */
                                ale->key_data = NULL;
                                ale->datatype = ALE_NONE;
+                               break;
                        }
-                       break;
                }
        }
        
@@ -1654,20 +1645,20 @@ static size_t animdata_filter_ds_textures(bAnimContext *ac, ListBase *anim_data,
                {
                        Material *ma = (Material *)owner_id;
                        mtex = (MTex **)(&ma->mtex);
+                       break;
                }
-               break;
                case ID_LA:
                {
                        Lamp *la = (Lamp *)owner_id;
                        mtex = (MTex **)(&la->mtex);
+                       break;
                }
-               break;
                case ID_WO:
                {
                        World *wo = (World *)owner_id;
                        mtex = (MTex **)(&wo->mtex);
+                       break;
                }
-               break;
                default: 
                {
                        /* invalid/unsupported option */
@@ -1812,8 +1803,8 @@ static void animfilter_modifier_idpoin_cb(void *afm_ptr, Object *ob, ID **idpoin
                        if (!(afm->ads->filterflag & ADS_FILTER_NOTEX)) {       
                                afm->items += animdata_filter_ds_texture(afm->ac, &afm->tmp_data, afm->ads, tex, owner_id, afm->filter_mode);
                        }
+                       break;
                }
-               break;
                
                /* TODO: images? */
        }
@@ -1920,8 +1911,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
                        
                        type = ANIMTYPE_DSCAM;
                        expanded = FILTER_CAM_OBJD(ca);
+                       break;
                }
-               break;
                case OB_LAMP: /* ---------- Lamp ----------- */
                {
                        Lamp *la = (Lamp *)ob->data;
@@ -1931,8 +1922,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
                        
                        type = ANIMTYPE_DSLAM;
                        expanded = FILTER_LAM_OBJD(la);
+                       break;
                }
-               break;
                case OB_CURVE: /* ------- Curve ---------- */
                case OB_SURF: /* ------- Nurbs Surface ---------- */
                case OB_FONT: /* ------- Text Curve ---------- */
@@ -1944,8 +1935,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
                        
                        type = ANIMTYPE_DSCUR;
                        expanded = FILTER_CUR_OBJD(cu);
+                       break;
                }
-               break;
                case OB_MBALL: /* ------- MetaBall ---------- */
                {
                        MetaBall *mb = (MetaBall *)ob->data;
@@ -1955,8 +1946,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
                        
                        type = ANIMTYPE_DSMBALL;
                        expanded = FILTER_MBALL_OBJD(mb);
+                       break;
                }
-               break;
                case OB_ARMATURE: /* ------- Armature ---------- */
                {
                        bArmature *arm = (bArmature *)ob->data;
@@ -1966,8 +1957,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
                        
                        type = ANIMTYPE_DSARM;
                        expanded = FILTER_ARM_OBJD(arm);
+                       break;
                }
-               break;
                case OB_MESH: /* ------- Mesh ---------- */
                {
                        Mesh *me = (Mesh *)ob->data;
@@ -1977,8 +1968,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
                        
                        type = ANIMTYPE_DSMESH;
                        expanded = FILTER_MESH_OBJD(me);
+                       break;
                }
-               break;
                case OB_LATTICE: /* ---- Lattice ---- */
                {
                        Lattice *lt = (Lattice *)ob->data;
@@ -1988,16 +1979,16 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
                        
                        type = ANIMTYPE_DSLAT;
                        expanded = FILTER_LATTICE_OBJD(lt);
+                       break;
                }
-               break;
                case OB_SPEAKER: /* ---------- Speaker ----------- */
                {
                        Speaker *spk = (Speaker *)ob->data;
                        
                        type = ANIMTYPE_DSSPK;
                        expanded = FILTER_SPK_OBJD(spk);
+                       break;
                }
-               break;
        }
        
        /* add object data animation channels */
@@ -2020,8 +2011,8 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
                                /* textures */
                                if (!(ads->filterflag & ADS_FILTER_NOTEX))
                                        tmp_items += animdata_filter_ds_textures(ac, &tmp_data, ads, &la->id, filter_mode);
+                               break;
                        }
-                       break;
                }
        }
        END_ANIMFILTER_SUBCHANNELS;
@@ -2603,58 +2594,52 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo
                                /* the check for the DopeSheet summary is included here since the summary works here too */
                                if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
                                        items += animfilter_action(ac, anim_data, ads, data, filter_mode, (ID *)obact);
+                               break;
                        }
-                       break;
-                       
                        case ANIMCONT_SHAPEKEY: /* 'ShapeKey Editor' */
                        {
                                /* the check for the DopeSheet summary is included here since the summary works here too */
                                if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
                                        items = animdata_filter_shapekey(ac, anim_data, data, filter_mode);
+                               break;
                        }
-                       break;
-                               
                        case ANIMCONT_GPENCIL:
                        {
                                if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
                                        items = animdata_filter_gpencil(anim_data, data, filter_mode);
+                               break;
                        }
-                       break;
-                       
                        case ANIMCONT_MASK:
                        {
                                if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
                                        items = animdata_filter_mask(anim_data, data, filter_mode);
+                               break;
                        }
-                       break;
-                       
                        case ANIMCONT_DOPESHEET: /* 'DopeSheet Editor' */
                        {
                                /* the DopeSheet editor is the primary place where the DopeSheet summaries are useful */
                                if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
                                        items += animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
+                               break;
                        }
-                       break;
-                               
                        case ANIMCONT_FCURVES: /* Graph Editor -> F-Curves/Animation Editing */
                        case ANIMCONT_DRIVERS: /* Graph Editor -> Drivers Editing */
                        case ANIMCONT_NLA:     /* NLA Editor */
                        {
                                /* all of these editors use the basic DopeSheet data for filtering options, but don't have all the same features */
                                items = animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
+                               break;
                        }
-                       break;
-                       
                        case ANIMCONT_CHANNEL: /* animation channel */
                        {
                                bDopeSheet *ads = ac->ads;
                                
                                /* based on the channel type, filter relevant data for this */
                                items = animdata_filter_animchan(ac, anim_data, ads, data, filter_mode);
+                               break;
                        }
-                       break;
                }
-                       
+
                /* remove any 'weedy' entries */
                items = animdata_filter_remove_invalid(anim_data);
                
index 8c49bee3058bf561aea9c018c05f73c034d6d4f6..df93da8b7c187232ed113ac75af72694465b2356 100644 (file)
@@ -449,8 +449,8 @@ static char *get_driver_path_hack(bContext *C, PointerRNA *ptr, PropertyRNA *pro
                                                /* free old one */
                                                MEM_freeN(basepath);
                                        }
+                                       break;
                                }
-                               break;
                        }
                        
                        /* fix RNA pointer, as we've now changed the ID root by changing the paths */
index adea3bcdc314e25db609422fa678dc8aaefc8aaf..5ceca478b471bb5d598591300bf6905a9c9ce23e 100644 (file)
@@ -242,8 +242,8 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
                                else 
                                        uiDefBut(block, LABEL, 1, ")  ", 0, 0, 2 * UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
                        }
+                       break;
                }
-               break;
        }
 }
 
index d9d2180e184e558c5f78ece6b88388d1cc3fa1c0..4e6cc53f962c155999a2b8f908d2df419fc5d94e 100644 (file)
@@ -601,30 +601,27 @@ void draw_keyframe_shape(float x, float y, float xscale, float hsize, short sel,
                        {
                                if (sel) glColor4f(0.33f, 0.75f, 0.93f, alpha);
                                else glColor4f(0.70f, 0.86f, 0.91f, alpha);
+                               break;
                        }
-                       break;
-                               
                        case BEZT_KEYTYPE_EXTREME: /* redish frames for now */
                        {
                                if (sel) glColor4f(0.95f, 0.5f, 0.5f, alpha);
                                else glColor4f(0.91f, 0.70f, 0.80f, alpha);
+                               break;
                        }
-                       break;
-                               
                        case BEZT_KEYTYPE_JITTER: /* greenish frames for now? */
                        {
                                if (sel) glColor4f(0.38f, 0.75f, 0.26f, alpha);
                                else glColor4f(0.58f, 0.90f, 0.46f, alpha);
+                               break;
                        }
-                       break;
-                               
                        case BEZT_KEYTYPE_KEYFRAME: /* traditional yellowish frames for now */
                        default:
                        {
                                if (sel) UI_ThemeColorShadeAlpha(TH_STRIP_SELECT, 50, -255 * (1.0f - alpha));
                                else glColor4f(0.91f, 0.91f, 0.91f, alpha);
+                     &