Merging r48862 through r48868 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 12 Jul 2012 17:19:54 +0000 (17:19 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 12 Jul 2012 17:19:54 +0000 (17:19 +0000)
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/transform/transform.c

index 55cc47d98d5c45564fad2373adc8690d0e946dca..a876c607cd370101bbaa6d4afa7324bda435fbaf 100644 (file)
@@ -1826,15 +1826,9 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
 
         layout.separator()
 
-        layout.operator("TRANSFORM_OT_edge_slide")
-        layout.operator("TRANSFORM_OT_edge_crease")
+        layout.operator("transform.edge_slide")
         layout.operator("mesh.loop_multi_select", text="Edge Loop").ring = False
-
-        #~ uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1);
-        #~ uiItemO(layout, "Edge Slide", 0, "mesh.edge_slide"); // EdgeSlide(em, 0,0.0);
-
         layout.operator("mesh.loop_multi_select", text="Edge Ring").ring = True
-
         layout.operator("mesh.loop_to_region")
         layout.operator("mesh.region_to_loop")
 
@@ -1869,9 +1863,6 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
 
         layout.separator()
 
-        # uiItemO(layout, NULL, 0, "mesh.face_mode"); // mesh_set_face_flags(em, 1);
-        # uiItemBooleanO(layout, NULL, 0, "mesh.face_mode", "clear", 1); // mesh_set_face_flags(em, 0);
-
         layout.operator("mesh.edge_rotate", text="Rotate Edge CW").direction = 'CW'
 
         layout.separator()
index 5f92752d5aa8f74da5134d7f7538cf7f627f2f4d..b7df636f9cb8f0ce6d58114d50ecea904a333805 100644 (file)
@@ -3733,7 +3733,14 @@ static void lib_link_mesh(FileData *fd, Main *main)
                                
                                G.main = gmain;
                        }
-                       
+               }
+       }
+
+       /* convert texface options to material */
+       convert_tface_mt(fd, main);
+
+       for (me = main->mesh.first; me; me = me->id.next) {
+               if (me->id.flag & LIB_NEEDLINK) {
                        /*
                         * Re-tessellate, even if the polys were just created from tessfaces, this
                         * is important because it:
@@ -3749,13 +3756,10 @@ static void lib_link_mesh(FileData *fd, Main *main)
 #else
                        BKE_mesh_tessface_clear(me);
 #endif
-                       
+
                        me->id.flag -= LIB_NEEDLINK;
                }
        }
-       
-       /* convert texface options to material */
-       convert_tface_mt(fd, main);
 }
 
 static void direct_link_dverts(FileData *fd, int count, MDeformVert *mdverts)
index 7d76994c07ada4b1ffd8543e1bc5a8309f7c2280..c4e72fa4a51e323150b60080522b4343981ae048 100644 (file)
@@ -1200,7 +1200,8 @@ static int node_group_ungroup(bNodeTree *ntree, bNode *gnode)
                        nodeRemLink(wgroup, link);
        }
        /* restore links from internal nodes */
-       for (link = wgroup->links.first; link; link = link->next) {
+       for (link = wgroup->links.first; link; link = linkn) {
+               linkn = link->next;
                /* indicates link to group input */
                if (!link->fromnode) {
                        /* NB: can't use find_group_node_input here,
index 41d69030e1ac4026192e0f72cc04349924edc4fc..112f41278b774c8b4c0661b06166f8a7fc0ba3df 100644 (file)
@@ -466,7 +466,8 @@ static DMDrawOption draw_tface__set_draw(MTFace *tface, int has_mcol, int matnr)
                return DM_DRAW_OPTION_NORMAL; /* Set color from mcol */
        }
 }
-static void add_tface_color_layer(DerivedMesh *dm)
+
+static void update_tface_color_layer(DerivedMesh *dm)
 {
        MTFace *tface = DM_get_tessface_data_layer(dm, CD_MTFACE);
        MFace *mface = dm->getTessFaceArray(dm);
@@ -476,7 +477,15 @@ static void add_tface_color_layer(DerivedMesh *dm)
        if (!mcol)
                mcol = dm->getTessFaceDataArray(dm, CD_MCOL);
 
-       finalCol = MEM_mallocN(sizeof(MCol) * 4 * dm->getNumTessFaces(dm), "add_tface_color_layer");
+       if (CustomData_has_layer(&dm->faceData, CD_TEXTURE_MCOL)) {
+               finalCol = CustomData_get_layer(&dm->faceData, CD_TEXTURE_MCOL);
+       }
+       else {
+               finalCol = MEM_mallocN(sizeof(MCol) * 4 * dm->getNumTessFaces(dm), "add_tface_color_layer");
+
+               CustomData_add_layer(&dm->faceData, CD_TEXTURE_MCOL, CD_ASSIGN, finalCol, dm->numTessFaceData);
+       }
+
        for (i = 0; i < dm->getNumTessFaces(dm); i++) {
                Material *ma = give_current_material(Gtexdraw.ob, mface[i].mat_nr + 1);
 
@@ -542,7 +551,6 @@ static void add_tface_color_layer(DerivedMesh *dm)
                        }
                }
        }
-       CustomData_add_layer(&dm->faceData, CD_TEXTURE_MCOL, CD_ASSIGN, finalCol, dm->numTessFaceData);
 }
 
 static DMDrawOption draw_tface_mapped__set_draw(void *userData, int index)
@@ -797,8 +805,7 @@ void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
                else {
                        drawTFace_userData userData;
 
-                       if (!CustomData_has_layer(&dm->faceData, CD_TEXTURE_MCOL))
-                               add_tface_color_layer(dm);
+                       update_tface_color_layer(dm);
 
                        userData.mf = DM_get_tessface_data_layer(dm, CD_MFACE);
                        userData.tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
index 1e9ecdd0e52c28052902342c555936dff8832d0f..b355e1ee436ce43ad3ebf06f8ea9099a8cc8ad40 100644 (file)
@@ -1676,19 +1676,25 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
 
        /* Stupid code to have Ctrl-Click on manipulator work ok */
        if (event) {
-               wmKeyMap *keymap = WM_keymap_active(CTX_wm_manager(C), op->type->modalkeymap);
-               wmKeyMapItem *kmi;
-
-               for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
-                       if (kmi->propvalue == TFM_MODAL_SNAP_INV_ON && kmi->val == KM_PRESS) {
-                               if ((ELEM(kmi->type, LEFTCTRLKEY, RIGHTCTRLKEY) &&   event->ctrl)  ||
-                                   (ELEM(kmi->type, LEFTSHIFTKEY, RIGHTSHIFTKEY) && event->shift) ||
-                                   (ELEM(kmi->type, LEFTALTKEY, RIGHTALTKEY) &&     event->alt)   ||
-                                   ((kmi->type == OSKEY) &&                         event->oskey) )
-                               {
-                                       t->modifiers |= MOD_SNAP_INVERT;
+               /* do this only for translation/rotation/resize due to only this
+                * moded are available from manipulator and doing such check could
+                * lead to keymap conflicts for other modes (see #31584)
+                */
+               if (ELEM3(mode, TFM_TRANSLATION, TFM_ROTATION, TFM_RESIZE)) {
+                       wmKeyMap *keymap = WM_keymap_active(CTX_wm_manager(C), op->type->modalkeymap);
+                       wmKeyMapItem *kmi;
+
+                       for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
+                               if (kmi->propvalue == TFM_MODAL_SNAP_INV_ON && kmi->val == KM_PRESS) {
+                                       if ((ELEM(kmi->type, LEFTCTRLKEY, RIGHTCTRLKEY) &&   event->ctrl)  ||
+                                           (ELEM(kmi->type, LEFTSHIFTKEY, RIGHTSHIFTKEY) && event->shift) ||
+                                           (ELEM(kmi->type, LEFTALTKEY, RIGHTALTKEY) &&     event->alt)   ||
+                                           ((kmi->type == OSKEY) &&                         event->oskey) )
+                                       {
+                                               t->modifiers |= MOD_SNAP_INVERT;
+                                       }
+                                       break;
                                }
-                               break;
                        }
                }