== Transform Limiting Constraints ==
authorJoshua Leung <aligorith@gmail.com>
Sun, 17 Dec 2006 10:02:23 +0000 (10:02 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sun, 17 Dec 2006 10:02:23 +0000 (10:02 +0000)
Two tweaks:
* Reduced the amount of empty space at the bottom of these constraints.
* When using the Add Constraint menu (Ctrl Alt C) to add new constraints,
an empty is no longer created when creating a "Limit *" constraint.

source/blender/src/buttons_object.c
source/blender/src/editconstraint.c

index a5eb7f02793b790d81dcbd6e717405b66af08745..e2d1a1d4b99d0aee583243c28cf95ab56bbdf64e 100644 (file)
@@ -1010,7 +1010,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                                int togButWidth = 50;
                                int textButWidth = ((width/2)-togButWidth);
                                
-                               height = 118
+                               height = 106
                                uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); 
                                
                                /* Draw Pairs of LimitToggle+LimitValue */
@@ -1060,10 +1060,13 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                case CONSTRAINT_TYPE_ROTLIMIT:
                        {
                                bRotLimitConstraint *data = con->data;
-                               
                                int normButWidth = (width/3);
                                
-                               height = 118; 
+                               if (ob->type == OB_ARMATURE && (ob->flag & OB_POSEMODE))
+                                       height = 106; 
+                               else
+                                       height = 78;
+                               
                                uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); 
                                
                                /* Draw Pairs of LimitToggle+LimitValue */
@@ -1100,7 +1103,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                                int togButWidth = 50;
                                int textButWidth = ((width/2)-togButWidth);
                                
-                               height = 90
+                               height = 78
                                uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); 
                                
                                /* Draw Pairs of LimitToggle+LimitValue */
index b51b05bf10d7eed751671dd4b0cf3b2a84d6ee71..ba0b43c16a8c05e1adea00c591392b9789d75954 100644 (file)
@@ -749,7 +749,7 @@ void add_constraint(int only_IK)
        else if(obsel) {
                set_constraint_target(con, obsel, NULL);
        }
-       else if(nr!=11) {       /* add new empty as target */
+       else if(ELEM4(nr, 11, 13, 14, 15)==0) { /* add new empty as target */
                Base *base= BASACT, *newbase;
                Object *obt;