Merging r50119 through r50132 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 22 Aug 2012 17:23:02 +0000 (17:23 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 22 Aug 2012 17:23:02 +0000 (17:23 +0000)
22 files changed:
doc/python_api/rst/info_gotcha.rst
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_material.h
source/blender/blenkernel/intern/material.c
source/blender/bmesh/operators/bmo_connect.c
source/blender/bmesh/operators/bmo_utils.c
source/blender/editors/interface/interface.c
source/blender/editors/render/render_preview.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_add.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_relationships.c
source/blender/editors/transform/transform.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/python/bmesh/bmesh_py_types.c
source/blender/python/intern/bpy_operator.c

index eb312799b41a59a85d8e495942f8b9ef97a6c1d1..1d561216b52ec8c1524d005888e3c59829dfb531 100644 (file)
@@ -137,11 +137,11 @@ For the time being this limitation just has to be worked around but we're aware
 NGons and Tessellation Faces
 ============================
 
-Since 2.63 NGons are supported, this adds some complexity since in some cases you need to access triangles still (some exporters for example).
+Since 2.63 NGons are supported, this adds some complexity since in some cases you need to access triangles/quads still (some exporters for example).
 
 There are now 3 ways to access faces:
 
-* :class:`bpy.types.MeshPolygon` - this is the data stricture which now stores faces in object mode (access as ``mesh.polygons`` rather then ``mesh.faces``).
+* :class:`bpy.types.MeshPolygon` - this is the data structure which now stores faces in object mode (access as ``mesh.polygons`` rather then ``mesh.faces``).
 * :class:`bpy.types.MeshTessFace` - the result of triangulating (tessellated) polygons, the main method of face access in 2.62 or older (access as ``mesh.tessfaces``).
 * :class:`bmesh.types.BMFace` - the polygons as used in editmode.
 
index d81f53d4fa670bb089e624f6b9de234c87a0d02a..5db103466a9756077009e4293c65708a0ddce712 100644 (file)
@@ -1182,7 +1182,7 @@ class VIEW3D_MT_hook(Menu):
         layout = self.layout
         layout.operator_context = 'EXEC_AREA'
         layout.operator("object.hook_add_newob")
-        layout.operator("object.hook_add_selob")
+        layout.operator("object.hook_add_selob").use_bone = False
         layout.operator("object.hook_add_selob", text="Hook to Selected Object Bone").use_bone = True
 
         if [mod.type == 'HOOK' for mod in context.active_object.modifiers]:
index 030af85ba849ddd1e18fe9c3a5b3d5749713fb1b..dd1b1a7752bffeb8e90180e0580d37fee5655460 100644 (file)
@@ -48,6 +48,7 @@ struct Scene;
 
 void init_def_material(void);
 void BKE_material_free(struct Material *sc); 
+void BKE_material_free_ex(struct Material *ma, int do_id_user);
 void test_object_materials(struct ID *id);
 void resize_object_material(struct Object *ob, const short totcol);
 void init_material(struct Material *ma);
index 8a26a1b52c5c9805af3c1ca2b461f18a776dd1be..fd167c69e628f538d2ac1be7848543a7779281d5 100644 (file)
@@ -79,13 +79,19 @@ void init_def_material(void)
 
 /* not material itself */
 void BKE_material_free(Material *ma)
+{
+       BKE_material_free_ex(ma, TRUE);
+}
+
+/* not material itself */
+void BKE_material_free_ex(Material *ma, int do_id_user)
 {
        MTex *mtex;
        int a;
        
        for (a = 0; a < MAX_MTEX; a++) {
                mtex = ma->mtex[a];
-               if (mtex && mtex->tex) mtex->tex->id.us--;
+               if (do_id_user && mtex && mtex->tex) mtex->tex->id.us--;
                if (mtex) MEM_freeN(mtex);
        }
        
@@ -101,7 +107,7 @@ void BKE_material_free(Material *ma)
        
        /* is no lib link block, but material extension */
        if (ma->nodetree) {
-               ntreeFreeTree(ma->nodetree);
+               ntreeFreeTree_ex(ma->nodetree, do_id_user);
                MEM_freeN(ma->nodetree);
        }
 
index 7418be3565cbd4fc2ced99561746d47e60cf2a4b..a9599a4858937b483b8830c9560a5168e9bfb0e2 100644 (file)
@@ -370,39 +370,36 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
                        }
                }
 
-               /* Find the shortest distance from a vert in vv1 to vv2[0]. Use that
-                * vertex in vv1 as a starting point in the first loop, while starting
-                * from vv2[0] in the second loop. This is a simplistic attempt to get
-                * a better edge-to-edge match between the two loops. */
+               /* Find the smallest sum of distances from verts in vv1 to verts in vv2,
+                * finding a starting point in the first loop, to start with vv2[0] in the
+                * second loop. This is a simplistic attempt to get a better edge-to-edge
+                * match between two loops. */
                if (cl1) {
-                       int previ, nexti;
                        float min = 1e32;
 
-                       /* BMESH_TODO: Would be nice to do a more thorough analysis of all
-                        * the vertices in both loops to find a more accurate match for the
-                        * starting point and winding direction of the bridge generation. */
-                       
-                       for (i = 0; i < BLI_array_count(vv1); i++) {
-                               if (len_v3v3(vv1[i]->co, vv2[0]->co) < min) {
-                                       min = len_v3v3(vv1[i]->co, vv2[0]->co);
+                       for (i = 0; i < lenv1; i++) {
+                               float len;
+
+                               /* compute summed length between vertices in forward direction */
+                               len = 0.0f;
+                               for (j = 0; j < lenv2; j++)
+                                       len += len_v3v3(vv1[clamp_index(i+j, lenv1)]->co, vv2[j]->co);
+
+                               if (len < min) {
+                                       min = len;
                                        starti = i;
                                }
-                       }
 
-                       /* Reverse iteration order for the first loop if the distance of
-                        * the (starti - 1) vert from vv1 is a better match for vv2[1] than
-                        * the (starti + 1) vert.
-                        *
-                        * This is not always going to be right, but it will work better in
-                        * the average case.
-                        */
-                       previ = clamp_index(starti - 1, lenv1);
-                       nexti = clamp_index(starti + 1, lenv1);
-
-                       /* avoid sqrt for comparison */
-                       if (len_squared_v3v3(vv1[nexti]->co, vv2[1]->co) > len_squared_v3v3(vv1[previ]->co, vv2[1]->co)) {
-                               /* reverse direction for reading vv1 (1 is forward, -1 is backward) */
-                               dir1 = -1;
+                               /* compute summed length between vertices in backward direction */
+                               len = 0.0f;
+                               for (j = 0; j < lenv2; j++)
+                                       len += len_v3v3(vv1[clamp_index(i-j, lenv1)]->co, vv2[j]->co);
+
+                               if (len < min) {
+                                       min = len;
+                                       starti = i;
+                                       dir1 = -1;
+                               }
                        }
                }
 
index 1d73435032dea162fc68f8b8f7c99056eb1d6085..88ed1250264d02920781eb040525054c0a66dfad 100644 (file)
@@ -182,14 +182,17 @@ static void bmo_region_extend_extend(BMesh *bm, BMOperator *op, int usefaces)
        if (!usefaces) {
                BMO_ITER (v, &siter, bm, op, "geom", BM_VERT) {
                        BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
-                               if (!BMO_elem_flag_test(bm, e, SEL_ORIG))
-                                       break;
+                               if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN))
+                                       if (!BMO_elem_flag_test(bm, e, SEL_ORIG))
+                                               break;
                        }
 
                        if (e) {
                                BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
-                                       BMO_elem_flag_enable(bm, e, SEL_FLAG);
-                                       BMO_elem_flag_enable(bm, BM_edge_other_vert(e, v), SEL_FLAG);
+                                       if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
+                                               BMO_elem_flag_enable(bm, e, SEL_FLAG);
+                                               BMO_elem_flag_enable(bm, BM_edge_other_vert(e, v), SEL_FLAG);
+                                       }
                                }
                        }
                }
@@ -202,8 +205,10 @@ static void bmo_region_extend_extend(BMesh *bm, BMOperator *op, int usefaces)
                BMO_ITER (f, &siter, bm, op, "geom", BM_FACE) {
                        BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
                                BM_ITER_ELEM (f2, &fiter, l->e, BM_FACES_OF_EDGE) {
-                                       if (!BMO_elem_flag_test(bm, f2, SEL_ORIG)) {
-                                               BMO_elem_flag_enable(bm, f2, SEL_FLAG);
+                                       if (!BM_elem_flag_test(f2, BM_ELEM_HIDDEN)) {
+                                               if (!BMO_elem_flag_test(bm, f2, SEL_ORIG)) {
+                                                       BMO_elem_flag_enable(bm, f2, SEL_FLAG);
+                                               }
                                        }
                                }
                        }
@@ -221,15 +226,18 @@ static void bmo_region_extend_constrict(BMesh *bm, BMOperator *op, int usefaces)
        if (!usefaces) {
                BMO_ITER (v, &siter, bm, op, "geom", BM_VERT) {
                        BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
-                               if (!BMO_elem_flag_test(bm, e, SEL_ORIG))
-                                       break;
+                               if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN))
+                                       if (!BMO_elem_flag_test(bm, e, SEL_ORIG))
+                                               break;
                        }
 
                        if (e) {
                                BMO_elem_flag_enable(bm, v, SEL_FLAG);
 
                                BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) {
-                                       BMO_elem_flag_enable(bm, e, SEL_FLAG);
+                                       if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) {
+                                               BMO_elem_flag_enable(bm, e, SEL_FLAG);
+                                       }
                                }
 
                        }
@@ -243,9 +251,11 @@ static void bmo_region_extend_constrict(BMesh *bm, BMOperator *op, int usefaces)
                BMO_ITER (f, &siter, bm, op, "geom", BM_FACE) {
                        BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
                                BM_ITER_ELEM (f2, &fiter, l->e, BM_FACES_OF_EDGE) {
-                                       if (!BMO_elem_flag_test(bm, f2, SEL_ORIG)) {
-                                               BMO_elem_flag_enable(bm, f, SEL_FLAG);
-                                               break;
+                                       if (!BM_elem_flag_test(f2, BM_ELEM_HIDDEN)) {
+                                               if (!BMO_elem_flag_test(bm, f2, SEL_ORIG)) {
+                                                       BMO_elem_flag_enable(bm, f, SEL_FLAG);
+                                                       break;
+                                               }
                                        }
                                }
                        }
index 10917f23cdd7891f7b9cc36a2e1b8f44f99b715f..37a110ba33b376707c8537082edb54b98674fb00 100644 (file)
@@ -3814,7 +3814,9 @@ void uiButGetStrInfo(bContext *C, uiBut *but, int nbr, ...)
 
                                if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, TRUE,
                                                                 buf, sizeof(buf)))
+                               {
                                        tmp = BLI_strdup(buf);
+                               }
                        }
                }
 
index 84319061d52951d4087742ed37f579535dcc54d8..add2cbd566bf1d7bfaeef7fc03e1f937cf173ca3 100644 (file)
@@ -749,7 +749,6 @@ static void shader_preview_free(void *customdata)
        
        if (sp->matcopy) {
                struct IDProperty *properties;
-               int a;
                
                /* node previews */
                shader_preview_updatejob(sp);
@@ -757,13 +756,7 @@ static void shader_preview_free(void *customdata)
                /* get rid of copied material */
                BLI_remlink(&pr_main->mat, sp->matcopy);
                
-               /* BKE_material_free decrements texture, prevent this. hack alert! */
-               for (a = 0; a < MAX_MTEX; a++) {
-                       MTex *mtex = sp->matcopy->mtex[a];
-                       if (mtex && mtex->tex) mtex->tex = NULL;
-               }
-               
-               BKE_material_free(sp->matcopy);
+               BKE_material_free_ex(sp->matcopy, FALSE);
 
                properties = IDP_GetProperties((ID *)sp->matcopy, FALSE);
                if (properties) {
index 560174e73ae238c34cb400de74cea28290f54335..104f727c60388cf1b15d3a37a1d3ce9705858751 100644 (file)
@@ -624,7 +624,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
        
        /* Sculpt mode */
        keymap = WM_keymap_find(keyconf, "Sculpt", 0, 0);
-       keymap->poll = sculpt_poll;
+       keymap->poll = sculpt_mode_poll;
 
        RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0,        0)->ptr, "mode", BRUSH_STROKE_NORMAL);
        RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, KM_CTRL,  0)->ptr, "mode", BRUSH_STROKE_INVERT);
index 1caf1075ae66d46dfd6db1c2bb88505b7c8e040a..1a50f72153adb54720bdd027aabe451acc4f1e02 100644 (file)
@@ -302,48 +302,48 @@ static void logic_header_area_draw(const bContext *C, ARegion *ar)
 /* only called once, from space/spacetypes.c */
 void ED_spacetype_logic(void)
 {
-       SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype logic");
+       SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype logic");
        ARegionType *art;
        
-       st->spaceid= SPACE_LOGIC;
+       st->spaceid = SPACE_LOGIC;
        strncpy(st->name, "Logic", BKE_ST_MAXNAME);
        
-       st->new= logic_new;
-       st->free= logic_free;
-       st->init= logic_init;
-       st->duplicate= logic_duplicate;
-       st->operatortypes= logic_operatortypes;
-       st->keymap= logic_keymap;
-       st->refresh= logic_refresh;
-       st->context= logic_context;
+       st->new = logic_new;
+       st->free = logic_free;
+       st->init = logic_init;
+       st->duplicate = logic_duplicate;
+       st->operatortypes = logic_operatortypes;
+       st->keymap = logic_keymap;
+       st->refresh = logic_refresh;
+       st->context = logic_context;
        
        /* regions: main window */
-       art= MEM_callocN(sizeof(ARegionType), "spacetype logic region");
+       art = MEM_callocN(sizeof(ARegionType), "spacetype logic region");
        art->regionid = RGN_TYPE_WINDOW;
-       art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES|ED_KEYMAP_VIEW2D;
-       art->init= logic_main_area_init;
-       art->draw= logic_main_area_draw;
-       art->listener= logic_listener;
+       art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES | ED_KEYMAP_VIEW2D;
+       art->init = logic_main_area_init;
+       art->draw = logic_main_area_draw;
+       art->listener = logic_listener;
 
        BLI_addhead(&st->regiontypes, art);
        
        /* regions: listview/buttons */
-       art= MEM_callocN(sizeof(ARegionType), "spacetype logic region");
+       art = MEM_callocN(sizeof(ARegionType), "spacetype logic region");
        art->regionid = RGN_TYPE_UI;
        art->prefsizex= 220; // XXX
-       art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES;
-       art->listener= logic_listener;
-       art->init= logic_buttons_area_init;
-       art->draw= logic_buttons_area_draw;
+       art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
+       art->listener = logic_listener;
+       art->init = logic_buttons_area_init;
+       art->draw = logic_buttons_area_draw;
        BLI_addhead(&st->regiontypes, art);
 
        /* regions: header */
        art= MEM_callocN(sizeof(ARegionType), "spacetype logic region");
        art->regionid = RGN_TYPE_HEADER;
-       art->prefsizey= HEADERY;
-       art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_HEADER;
-       art->init= logic_header_area_init;
-       art->draw= logic_header_area_draw;
+       art->prefsizey = HEADERY;
+       art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER;
+       art->init = logic_header_area_init;
+       art->draw = logic_header_area_draw;
        
        BLI_addhead(&st->regiontypes, art);
        
index ad61fe571c26035dee046eefa10c2a4250b6d7a4..ddea7da929ac1d49aad7174acbe216ba038b9f41 100644 (file)
@@ -858,13 +858,13 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
                        while (gsock && (!sock || sock->groupsock != gsock)) {
                                draw_group_socket(C, snode, ntree, gnode, NULL, gsock, index, SOCK_IN);
                                gsock = gsock->next;
-                               ++index;
+                               index++;
                        }
                        while (sock && gsock && sock->groupsock == gsock) {
                                draw_group_socket(C, snode, ntree, gnode, sock, gsock, index, SOCK_IN);
                                sock = sock->next;
                                gsock = gsock->next;
-                               ++index;
+                               index++;
                        }
                }
                gsock = ngroup->outputs.first;
@@ -878,13 +878,13 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
                        while (gsock && (!sock || sock->groupsock != gsock)) {
                                draw_group_socket(C, snode, ntree, gnode, NULL, gsock, index, SOCK_OUT);
                                gsock = gsock->next;
-                               ++index;
+                               index++;
                        }
                        while (sock && gsock && sock->groupsock == gsock) {
                                draw_group_socket(C, snode, ntree, gnode, sock, gsock, index, SOCK_OUT);
                                sock = sock->next;
                                gsock = gsock->next;
-                               ++index;
+                               index++;
                        }
                }
                
index 7d007d024abe38c09ea180915b6fc01d8ee37b12..99d49fa1e8f4fcd22596c80f7946c1a8a7097d09 100644 (file)
@@ -25,7 +25,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/editors/space_node/node_relationships.c
+/** \file blender/editors/space_node/node_add.c
  *  \ingroup spnode
  */
 
@@ -360,7 +360,7 @@ static int new_node_tree_exec(bContext *C, wmOperator *op)
                /* RNA_property_pointer_set increases the user count,
                 * fixed here as the editor is the initial user.
                 */
-               --ntree->id.us;
+               ntree->id.us++;
                RNA_property_update(C, &ptr, prop);
        }
        else if (snode) {
index 9319baf99f7541b58d3088b07721bbd600db4f17..0f4332e70243fee3d09afaf543363efb28751675 100644 (file)
@@ -226,12 +226,12 @@ void ED_node_sort(bNodeTree *ntree)
                        while (a < k && b < k && node_b) {
                                if (compare_nodes(node_a, node_b) == 0) {
                                        node_a = node_a->next;
-                                       ++a;
+                                       a++;
                                }
                                else {
                                        tmp = node_b;
                                        node_b = node_b->next;
-                                       ++b;
+                                       b++;
                                        BLI_remlink(&ntree->nodes, tmp);
                                        BLI_insertlinkbefore(&ntree->nodes, node_a, tmp);
                                }
index 4423b340d77e136b68539ef8bd5d934d735d27ef..382c02c8765e1029e2ecd99778b4ba9b9c4be718 100644 (file)
@@ -1838,7 +1838,7 @@ static int node_output_file_move_active_socket_exec(bContext *C, wmOperator *op)
                        return OPERATOR_CANCELLED;
                BLI_remlink(&node->inputs, sock);
                BLI_insertlinkbefore(&node->inputs, before, sock);
-               --nimf->active_input;
+               nimf->active_input--;
        }
        else {
                bNodeSocket *after = sock->next;
@@ -1846,7 +1846,7 @@ static int node_output_file_move_active_socket_exec(bContext *C, wmOperator *op)
                        return OPERATOR_CANCELLED;
                BLI_remlink(&node->inputs, sock);
                BLI_insertlinkafter(&node->inputs, after, sock);
-               ++nimf->active_input;
+               nimf->active_input++;
        }
        
        snode_notify(C, snode);
index 6295a568113f07c02fef3a3ece18af55c026b4ff..f5a65065895a09a59a4cc43aab21473d34b8eee9 100644 (file)
@@ -224,8 +224,9 @@ static void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace)
                                if (!sock_fr)
                                        continue;
 
-                               if (snode_autoconnect_input(snode, node_fr, sock_fr, node_to, sock_to, replace))
-                                       ++numlinks;
+                               if (snode_autoconnect_input(snode, node_fr, sock_fr, node_to, sock_to, replace)) {
+                                       numlinks++;
+                               }
                        }
                }
 
@@ -246,7 +247,7 @@ static void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace)
                                        continue;
 
                                if (snode_autoconnect_input(snode, node_fr, sock_fr, node_to, sock_to, replace)) {
-                                       ++numlinks;
+                                       numlinks++;
                                        break;
                                }
                        }
index 6b6da99cf393d569fcec26ca7ce9eb2d8e2d93e7..284c670fa082ee6a7e63c47b7cb7d50e19acd3ab 100644 (file)
@@ -4978,7 +4978,9 @@ static int createSlideVerts(TransInfo *t)
                                        /* This test is only relevant if object is not wire-drawn! See [#32068]. */
                                        if (v3d && t->obedit->dt > OB_WIRE && v3d->drawtype > OB_WIRE &&
                                            !BMBVH_EdgeVisible(btree, e2, ar, v3d, t->obedit))
+                                       {
                                                continue;
+                                       }
 
                                        j = GET_INT_FROM_POINTER(BLI_smallhash_lookup(&table, (uintptr_t)v));
 
index 54c5cbfce937d1621e2417010eb29de386adc52a..d3336d105c401349cd400592783f6a210c1f5634 100644 (file)
@@ -205,8 +205,8 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
                ED_image_get_uv_aspect(previma, prev_aspect, prev_aspect + 1);
                ED_image_get_uv_aspect(ima, aspect, aspect + 1);
 
-               fprev_aspect = prev_aspect[0]/prev_aspect[1];
-               faspect = aspect[0]/aspect[1];
+               fprev_aspect = prev_aspect[0] / prev_aspect[1];
+               faspect = aspect[0] / aspect[1];
 #endif
 
                /* ensure we have a uv map */
index b66a74497815a3da53a3d0c9a23874afe6f4c742..91876249bf604eb3cff3f77d969143481907964c 100644 (file)
@@ -728,8 +728,9 @@ static int imb_exr_split_token(const char *str, const char *end, const char **to
 {
        int maxlen = end - str;
        int len = 0;
-       while (len < maxlen && *(end - len - 1) != '.')
-               ++len;
+       while (len < maxlen && *(end - len - 1) != '.') {
+               len++;
+       }
 
        *token = end - len;
        return len;
index 29288612aa61513950b048601c0d40a0447bfe81..7a385103fe380f1426633e591d9c064bf314af40 100644 (file)
@@ -3746,7 +3746,7 @@ static void def_cmp_keying(StructRNA *srna)
        RNA_def_property_float_sdna(prop, NULL, "clip_white");
        RNA_def_property_range(prop, 0.0f, 1.0f);
        RNA_def_property_ui_text(prop, "Clip White", "Value of non-scaled matte pixel which considers as fully foreground pixel");
-       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+       RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 
        prop = RNA_def_property(srna, "blur_pre", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "blur_pre");
@@ -3825,12 +3825,12 @@ static void def_cmp_trackpos(StructRNA *srna)
        prop = RNA_def_property(srna, "tracking_object", PROP_STRING, PROP_NONE);
        RNA_def_property_string_sdna(prop, NULL, "tracking_object");
        RNA_def_property_ui_text(prop, "Tracking Object", "");
-       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+       RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 
        prop = RNA_def_property(srna, "track_name", PROP_STRING, PROP_NONE);
        RNA_def_property_string_sdna(prop, NULL, "track_name");
        RNA_def_property_ui_text(prop, "Track", "");
-       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+       RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 }
 
 /* -- Texture Nodes --------------------------------------------------------- */
index 5717fe697b10a05330a7c313ae92266f843dcb59..aeb72553bf76f0aa2dbb2a54456ce99197e1d50b 100644 (file)
@@ -62,7 +62,7 @@ typedef struct EffectInfo {
 EnumPropertyItem sequence_modifier_type_items[] = {
        {seqModifierType_ColorBalance, "COLOR_BALANCE", ICON_NONE, "Color Balance", ""},
        {seqModifierType_Curves, "CURVES", ICON_NONE, "Curves", ""},
-       {seqModifierType_HueCorrect,"HUE_CORRECT", ICON_NONE, "Hue Correct", ""},
+       {seqModifierType_HueCorrect, "HUE_CORRECT", ICON_NONE, "Hue Correct", ""},
        {0, NULL, 0, NULL, NULL}
 };
 
index 9270aec8d950750a3908b750e86e0814d85bead1..24e7cd575ed2c5262e1e523d3951e79dabdc5bef 100644 (file)
@@ -2159,7 +2159,9 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec
                                                 "|Oi:BMElemSeq.sort",
                                                 (char **)kwlist,
                                                 &keyfunc, &reverse))
+               {
                        return NULL;
+               }
        }
 
        if (keyfunc != NULL && !PyCallable_Check(keyfunc)) {
index 90ea589fde42363276f68b217650ae88d03cb4c0..55ef217e7819d69f797b225105d1d10635611e7a 100644 (file)
@@ -160,7 +160,9 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
        
        if (!PyArg_ParseTuple(args, "sO|O!si:_bpy.ops.call",
                              &opname, &context_dict, &PyDict_Type, &kw, &context_str, &is_undo))
+       {
                return NULL;
+       }
 
        ot = WM_operatortype_find(opname, TRUE);