svn merge -r 12716:12856 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / src / editobject.c
index 597e15154998b58d3992a6fee6beaf035ac9609c..134794b8d301510acee4ae6b4ec6c9c7a54b700c 100644 (file)
@@ -1161,7 +1161,7 @@ void make_vertex_parent(void)
                                bezt= nu->bezt;
                                a= nu->pntsu;
                                while(a--) {
-                                       if(BEZSELECTED(bezt)) {
+                                       if(BEZSELECTED_HIDDENHANDLES(bezt)) {
                                                if(v1==0) v1= nr;
                                                else if(v2==0) v2= nr;
                                                else if(v3==0) v3= nr;
@@ -2827,44 +2827,51 @@ void convertmenu(void)
         * level==-1 then toggle subsurf, else set to level.
      * *set allows to toggle multiple selections
         */
-static void object_flip_subdivison(Object *ob, int *set, int level, int mode)
+static void object_flip_subdivison(Object *ob, int *set, int level, int mode, int ingroup)
 {
        ModifierData *md;
 
-       if(ob->type!=OB_MESH)
-               return;
-       
-       md = modifiers_findByType(ob, eModifierType_Subsurf);
-       
-       if (md) {
-               SubsurfModifierData *smd = (SubsurfModifierData*) md;
-
-               if (level == -1) {
-                       if(*set == -1) 
-                               *set= smd->modifier.mode&(mode);
-                                                                                 
-                       if (*set) {
-                               smd->modifier.mode &= ~(mode);
+       if(ob->type==OB_MESH) {
+               md = modifiers_findByType(ob, eModifierType_Subsurf);
+               
+               if (md) {
+                       SubsurfModifierData *smd = (SubsurfModifierData*) md;
+
+                       if (level == -1) {
+                               if(*set == -1) 
+                                       *set= smd->modifier.mode&(mode);
+                                                                                         
+                               if (*set) {
+                                       smd->modifier.mode &= ~(mode);
+                               } else {
+                                       smd->modifier.mode |= (mode);
+                               }
                        } else {
-                               smd->modifier.mode |= (mode);
+                               smd->levels = level;
                        }
-               } else {
-                       smd->levels = level;
-               }
-       } 
-       else if(*set != 0) {
-               SubsurfModifierData *smd = (SubsurfModifierData*) modifier_new(eModifierType_Subsurf);
+               } 
+               else if(!ingroup && *set != 0) {
+                       SubsurfModifierData *smd = (SubsurfModifierData*) modifier_new(eModifierType_Subsurf);
 
-               BLI_addtail(&ob->modifiers, smd);
+                       BLI_addtail(&ob->modifiers, smd);
 
-               if (level!=-1) {
-                       smd->levels = level;
+                       if (level!=-1) {
+                               smd->levels = level;
+                       }
+                       
+                       if(*set == -1)
+                               *set= 1;
                }
-               
-               if(*set == -1)
-                       *set= 1;
+
+               ob->recalc |= OB_RECALC_DATA;
+       }
+
+       if(ob->dup_group) {
+               GroupObject *go;
+
+               for(go= ob->dup_group->gobject.first; go; go= go->next)
+                       object_flip_subdivison(go->ob, set, level, mode, 1);
        }
-       ob->recalc |= OB_RECALC_DATA;
 }
 
 /* Change subdivision properties of mesh object ob, if
@@ -2882,16 +2889,9 @@ void flip_subdivison(int level)
        else
                mode= eModifierMode_Render|eModifierMode_Realtime;
        
-       for(base= G.scene->base.first; base; base= base->next) {
-               if(((level==-1) && (TESTBASE(base))) || (TESTBASELIB(base))) {
-                       object_flip_subdivison(base->object, &set, level, mode);
-                       if(base->object->dup_group) {
-                               GroupObject *go;
-                               for(go= base->object->dup_group->gobject.first; go; go= go->next)
-                                       object_flip_subdivison(go->ob, &set, level, mode);
-                       }
-               }
-       }
+       for(base= G.scene->base.first; base; base= base->next)
+               if(((level==-1) && (TESTBASE(base))) || (TESTBASELIB(base)))
+                       object_flip_subdivison(base->object, &set, level, mode, 0);
        
        countall();
        allqueue(REDRAWVIEW3D, 0);