was missing depgraph update for centering objects in editmode if they were unselected.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 7 May 2008 20:34:34 +0000 (20:34 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 7 May 2008 20:34:34 +0000 (20:34 +0000)
ctrl+num keys for switching subsurf didnt work in editmode if the object wasnt selected. changed this to only operate on the editmode object. also
disallow ctrl+num to change layers for values above 4.

source/blender/src/editobject.c
source/blender/src/space.c

index cdc38ab1d2c689e036179df2ad2383b425de4193..4029e031b633d68fb560105323f1a86b8e6a07f5 100644 (file)
@@ -1887,6 +1887,7 @@ void docenter(int centermode)
                        
                        recalc_editnormals();
                        tot_change++;
+                       DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
                }
        }
        
@@ -3133,9 +3134,15 @@ void flip_subdivison(int level)
                mode= eModifierMode_Render|eModifierMode_Realtime;
        
        if(level == -1) {
-               for(base= G.scene->base.first; base; base= base->next)
-                       if(((level==-1) && (TESTBASE(base))) || (TESTBASELIB(base)))
-                               object_has_subdivision_particles(base->object, &havesubdiv, &havepart, 0);
+               if (G.obedit) {
+                       object_has_subdivision_particles(G.obedit, &havesubdiv, &havepart, 0);                  
+               } else {
+                       for(base= G.scene->base.first; base; base= base->next) {
+                               if(((level==-1) && (TESTBASE(base))) || (TESTBASELIB(base))) {
+                                       object_has_subdivision_particles(base->object, &havesubdiv, &havepart, 0);
+                               }
+                       }
+               }
        }
        else
                havesubdiv= 1;
@@ -3149,10 +3156,16 @@ void flip_subdivison(int level)
        }
        else if(havepart)
                particles= 1;
-       
-       for(base= G.scene->base.first; base; base= base->next)
-               if(((level==-1) && (TESTBASE(base))) || (TESTBASELIB(base)))
-                       object_flip_subdivison_particles(base->object, &set, level, mode, particles, 0);
+
+       if (G.obedit) { 
+               object_flip_subdivison_particles(G.obedit, &set, level, mode, particles, 0);
+       } else {
+               for(base= G.scene->base.first; base; base= base->next) {
+                       if(((level==-1) && (TESTBASE(base))) || (TESTBASELIB(base))) {
+                               object_flip_subdivison_particles(base->object, &set, level, mode, particles, 0);
+                       }
+               }
+       }
        
        countall();
        allqueue(REDRAWVIEW3D, 0);
index e396e0787391e2c2e395741c9f3147ea2f9d961b..63836101d490d928abc1f3242d138a027f450875 100644 (file)
@@ -1745,25 +1745,42 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                        if ( (G.obedit) && (G.obedit->type==OB_MESH) )
                                                select_faces_by_numverts(5);
                                }
+                               
+                               else if(G.qual==LR_CTRLKEY) {}
                                else do_layer_buttons(4);
                                break;
 
                        case SIXKEY:
-                               do_layer_buttons(5); break;
+                               if(G.qual==LR_CTRLKEY) {}
+                               else do_layer_buttons(5);
+                               break;
                        case SEVENKEY:
-                               do_layer_buttons(6); break;
+                               if(G.qual==LR_CTRLKEY) {}
+                               else do_layer_buttons(6);
+                               break;
                        case EIGHTKEY:
-                               do_layer_buttons(7); break;
+                               if(G.qual==LR_CTRLKEY) {}
+                               else do_layer_buttons(7);
+                               break;
                        case NINEKEY:
-                               do_layer_buttons(8); break;
+                               if(G.qual==LR_CTRLKEY) {}
+                               else do_layer_buttons(8);
+                               break;
                        case ZEROKEY:
-                               do_layer_buttons(9); break;
+                               if(G.qual==LR_CTRLKEY) {}
+                               else do_layer_buttons(9);
+                               break;
                        case MINUSKEY:
-                               do_layer_buttons(10); break;
+                               if(G.qual==LR_CTRLKEY) {}
+                               else do_layer_buttons(10);
+                               break;
                        case EQUALKEY:
-                               do_layer_buttons(11); break;
+                               if(G.qual==LR_CTRLKEY) {}
+                               else do_layer_buttons(11);
+                               break;
                        case ACCENTGRAVEKEY:
-                               do_layer_buttons(-1); break;
+                               do_layer_buttons(-1);
+                               break;
                        
                        case SPACEKEY:
                                if(G.qual == LR_CTRLKEY) {