svn merge -r 13323:13357 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / src / buttons_object.c
index 90f7dab0a588b15c65e50447942201bc946ecd54..7f62c5b3308af8efdc9b77695b741681b988a145 100644 (file)
@@ -1346,7 +1346,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                                bRotLimitConstraint *data = con->data;
                                int normButWidth = (width/3);
                                
                                bRotLimitConstraint *data = con->data;
                                int normButWidth = (width/3);
                                
-                               height = 106; 
+                               height = 136; 
                                
                                uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); 
                                
                                
                                uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-10, *yco-height, width+40,height-1, NULL, 5.0, 0.0, 12, rb_col, ""); 
                                
@@ -1369,8 +1369,11 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
                                        uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max:", *xco+(normButWidth * 2), *yco-72, normButWidth, 18, &(data->zmax), -360, 360, 0.1,0.5,"Highest z value to allow"); 
                                uiBlockEndAlign(block); 
                                
                                        uiDefButF(block, NUM, B_CONSTRAINT_TEST, "max:", *xco+(normButWidth * 2), *yco-72, normButWidth, 18, &(data->zmax), -360, 360, 0.1,0.5,"Highest z value to allow"); 
                                uiBlockEndAlign(block); 
                                
+                               /* special option(s) */
+                               uiDefButBitS(block, TOG, LIMIT_TRANSFORM, B_CONSTRAINT_TEST, "For Transform", *xco+(width/4), *yco-100, (width/2), 18, &data->flag2, 0, 24, 0, 0, "Transforms are affected by this constraint as well"); 
+                               
                                /* constraint space settings */
                                /* constraint space settings */
-                               draw_constraint_spaceselect(block, con, *xco, *yco-100, is_armature_owner(ob), -1);
+                               draw_constraint_spaceselect(block, con, *xco, *yco-130, is_armature_owner(ob), -1);
                        }
                        break;
                case CONSTRAINT_TYPE_SIZELIMIT:
                        }
                        break;
                case CONSTRAINT_TYPE_SIZELIMIT:
@@ -2445,9 +2448,16 @@ static void object_panel_object(Object *ob)
                uiNewPanelHeight(block, 204 - (120-yco));
 }
 
                uiNewPanelHeight(block, 204 - (120-yco));
 }
 
+static void object_panel_anim_timeoffset_callback( void *data, void *timeoffset_ui) {
+       Object *ob = (Object *)data;
+       ob->sf = (*(float *)timeoffset_ui) - (give_timeoffset(ob) - ob->sf);
+}
+
 static void object_panel_anim(Object *ob)
 {
        uiBlock *block;
 static void object_panel_anim(Object *ob)
 {
        uiBlock *block;
+       uiBut *but;
+       static float timeoffset_ui;
        char str[32];
        
        block= uiNewBlock(&curarea->uiblocks, "object_panel_anim", UI_EMBOSS, UI_HELV, curarea->win);
        char str[32];
        
        block= uiNewBlock(&curarea->uiblocks, "object_panel_anim", UI_EMBOSS, UI_HELV, curarea->win);
@@ -2499,7 +2509,11 @@ static void object_panel_anim(Object *ob)
        uiBlockEndAlign(block);
        
        uiBlockBeginAlign(block);
        uiBlockEndAlign(block);
        
        uiBlockBeginAlign(block);
-       uiDefButF(block, NUM, REDRAWALL, "TimeOffset:",                 24,35,115,20, &ob->sf, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Animation offset in frames for ipo's and dupligroup instances");
+       
+       timeoffset_ui = give_timeoffset(ob);
+       but = uiDefButF(block, NUM, REDRAWALL, "TimeOffset:",                   24,35,115,20, &timeoffset_ui, -MAXFRAMEF, MAXFRAMEF, 100, 0, "Animation offset in frames for ipo's and dupligroup instances");
+       uiButSetFunc(but, object_panel_anim_timeoffset_callback, ob, &timeoffset_ui);
+       
        uiDefBut(block, BUT, B_AUTOTIMEOFS, "Auto",     139,35,34,20, 0, 0, 0, 0, 0, "Assign selected objects a timeoffset within a range, starting from the active object");
        uiDefBut(block, BUT, B_OFSTIMEOFS, "Ofs",       173,35,34,20, 0, 0, 0, 0, 0, "Offset selected objects timeoffset");
        uiDefBut(block, BUT, B_RANDTIMEOFS, "Rand",     207,35,34,20, 0, 0, 0, 0, 0, "Randomize selected objects timeoffset");
        uiDefBut(block, BUT, B_AUTOTIMEOFS, "Auto",     139,35,34,20, 0, 0, 0, 0, 0, "Assign selected objects a timeoffset within a range, starting from the active object");
        uiDefBut(block, BUT, B_OFSTIMEOFS, "Ofs",       173,35,34,20, 0, 0, 0, 0, 0, "Offset selected objects timeoffset");
        uiDefBut(block, BUT, B_RANDTIMEOFS, "Rand",     207,35,34,20, 0, 0, 0, 0, 0, "Randomize selected objects timeoffset");