A couple of smaller fixes;
authorTon Roosendaal <ton@blender.org>
Sat, 20 Aug 2005 09:55:11 +0000 (09:55 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 20 Aug 2005 09:55:11 +0000 (09:55 +0000)
- Modifier Panel, name label for "Virtual" modifiers was too short
- On extrude Bones, "soft distance" now is always set based on length
  of the bone (also on CTRL+click, also when Envelope drawmode is not set)
- Added undo-push for "Apply Bone Envelopees to VertexGroup" in WeightPaint.
- Menu-buttons in floating panels sometimes gave drawing error
- InfoWindow buttons were always allocated & drawn, even when window was
  zero sized... waste of cpu, tsk!

source/blender/src/buttons_editing.c
source/blender/src/editarmature.c
source/blender/src/editobject.c
source/blender/src/interface.c
source/blender/src/interface_panel.c
source/blender/src/poseobject.c
source/blender/src/space.c
source/blender/src/transform_conversions.c
source/blender/src/transform_generics.c

index 2ad63245b880f1fd9e61094ef2c0479769fefbff..177ee1adcf874e36474e29646b739a986612edc2 100644 (file)
@@ -925,7 +925,7 @@ static void draw_modifier(uiBlock *block, Object *ob, ModifierData *md, int *xco
        
        if (isVirtual) {
                sprintf(str, "%s (virtual)", md->name);
-               uiDefBut(block, LABEL, 0, str, x+10, y-1, buttonWidth-60, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name"); 
+               uiDefBut(block, LABEL, 0, str, x+10, y-1, width-90, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Modifier name"); 
 
                uiClearButLock();
 
index c66f0760e8b2afb6a8db9723b958ba43fc743d58..a52964f8bbb99dda7b5b251e5974b85b1b9b1635 100644 (file)
@@ -1173,7 +1173,7 @@ static EditBone *add_editbone(void)
        
        bone->flag |= BONE_TIPSEL;
        bone->weight= 1.0F;
-       bone->dist= 1.0F;
+       bone->dist= 0.5F;
        bone->xwidth= 0.1;
        bone->zwidth= 0.1;
        bone->ease1= 1.0;
@@ -1300,6 +1300,10 @@ void addvert_armature(void)
        Mat3Inv(imat, mat);
        Mat3MulVecfl(imat, newbone->tail);
 
+       newbone->length= VecLenf(newbone->head, newbone->tail);
+       newbone->rad_tail= newbone->length*0.1f;
+       newbone->dist= newbone->length*0.25f;
+       
        countall();
        
        BIF_undo_push("Add Bone");
index 74e8000053f5f4a8a9578a72e7ad4c1c9cc4986a..3d46c7626edf99e1f53175dace60863f0094b257 100644 (file)
@@ -1958,8 +1958,11 @@ void special_editmenu(void)
                else if(G.f & G_WEIGHTPAINT) {
                        if(ob->parent && (ob->parent->flag & OB_POSEMODE)) {
                                nr= pupmenu("Specials%t|Apply Bone Envelopes to VertexGroups %x1");
-                               if(nr==1) 
+                               if(nr==1) {
+                                       Mesh *me= ob->data;
+                                       copy_wpaint_undo(me->dvert, me->totvert);
                                        pose_adds_vgroups(ob);
+                               }
                        }
                }
                else {
index 22e104711fd17912fbb8c93ec884218c7e56095b..8515168d84a9e29c47a5eddb86e3bf5b8f2e5b25 100644 (file)
@@ -1210,7 +1210,8 @@ static int ui_do_but_MENU(uiBut *but)
        
        but->flag &= ~UI_SELECT;
        ui_check_but(but);
-       ui_draw_but(but);
+       /* no draw of button now, for floating panels the matrix now is invalid...
+          the button still is active, and will be redrawn in main loop to de-activate it */
        
        uibut_do_func(but);
 
index a0583e9cf3be8d3c48cd20e8d269df383f555250..54bab5703a34c78ca01d78c571f41c0cfb71ef38 100644 (file)
@@ -721,7 +721,7 @@ void uiMatchPanel_view2d(ScrArea *sa)
        }       
 }
 
-/* extern used ny previewrender */
+/* extern used by previewrender */
 void uiPanelPush(uiBlock *block)
 {
        glPushMatrix(); 
@@ -896,7 +896,7 @@ static void ui_draw_panel_header(uiBlock *block)
                /* active tab */
                /* draw text label */
                BIF_ThemeColor(TH_TEXT_HI);
-               ui_rasterpos_safe(4+block->minx+pnl_icons, block->maxy+5, block->aspect);
+               ui_rasterpos_safe(4.0f+block->minx+pnl_icons, block->maxy+5.0f, block->aspect);
                BIF_DrawString(block->curfont, block->panel->panelname, (U.transopts & USER_TR_BUTTONS));
                return;
        }
@@ -960,7 +960,7 @@ void ui_draw_panel(uiBlock *block)
        
        if(panel->paneltab) return;
 
-       /* if the panel is minimised vertically:
+       /* if the panel is minimized vertically:
         * (------)
         */
        if(panel->flag & PNL_CLOSEDY) {
@@ -988,7 +988,7 @@ void ui_draw_panel(uiBlock *block)
                }
        
        }
-       /* if the panel is minimised horizontally:
+       /* if the panel is minimized horizontally:
         * /-\
         *  |
         *  |
index 616089659f74f3f2dff0ceb94812696dd8db3455..b400cd0bc3b8709467bdc3090c8b8ea648e9f4cb 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * $Id$
  *
- * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -22,7 +22,7 @@
  *
  * Contributor(s): Ton Roosendaal, Blender Foundation '05, full recode.
  *
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ * ***** END GPL LICENSE BLOCK *****
  * support for animation modes - Reevan McKay
  */
 
index ce676cf87a2be1c10ae75811e2ea10ddbf47023e..eaa4faf9e6257f7c13bca7d6d4bee0073e8de829 100644 (file)
@@ -2297,7 +2297,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
        short edgsp, midsp;
        char naam[32];
 
-       if(curarea->win==0) return;
+       if(curarea->win==0 || curarea->winy<2) return;
 
        BIF_GetThemeColor3fv(TH_BACK, col);
        glClearColor(col[0], col[1], col[2], 0.0);
index 88c0ce02452e98800b0bc5e78067ad2878791553..eda6c03554e521e0ef7e052e8ac128fb37afcd29 100755 (executable)
@@ -552,7 +552,7 @@ static void createTransArmatureVerts(TransInfo *t)
        
        for (ebo=G.edbo.first;ebo;ebo=ebo->next){
                
-               ebo->oldlength= ebo->length;    // might be used for scaling
+               ebo->oldlength= ebo->length;    // length==0.0 on extrude, used for scaling radius of bone points
                
                if (t->mode==TFM_BONE_ENVELOPE) {
                        
index 1e3b0e86f12c77df8c78c50116c36ca6d7f6114a..b7944a5fa1c6407a4047259d043fddfa29b5f8cc 100755 (executable)
@@ -183,14 +183,14 @@ void recalcData(TransInfo *t)
                                        }
                                }
                                
-                               if(arm->drawtype==ARM_ENVELOPE) {
-                                       if(ebo->oldlength==0.0f) {
-                                               ebo->rad_head= 0.25f*ebo->length;
-                                               ebo->rad_tail= 0.10f*ebo->length;
-                                               if(ebo->parent) {
-                                                       if(ebo->rad_head > ebo->parent->rad_tail)
-                                                               ebo->rad_head= ebo->parent->rad_tail;
-                                               }
+                               /* on extrude bones, oldlength==0.0f, so we scale radius of points */
+                               if(ebo->oldlength==0.0f) {
+                                       ebo->rad_head= 0.25f*ebo->length;
+                                       ebo->rad_tail= 0.10f*ebo->length;
+                                       ebo->dist= 0.25f*ebo->length;
+                                       if(ebo->parent) {
+                                               if(ebo->rad_head > ebo->parent->rad_tail)
+                                                       ebo->rad_head= ebo->parent->rad_tail;
                                        }
                                }
                        }