Stage two of the giant animation recode project; Ipo/Action/NLA cleanup
[blender.git] / source / blender / src / editobject.c
index cd7279b7878002d1b724d8182f2e93e929049149..d46c06bd4b9ecd39d24e73a5bfa9fafbb59b5536 100644 (file)
@@ -181,6 +181,7 @@ void add_object_draw(int type)      /* for toolbox or menus, only non-editmode stuff
        if ELEM3(curarea->spacetype, SPACE_VIEW3D, SPACE_BUTS, SPACE_INFO) {
                if (G.obedit) exit_editmode(2); // freedata, and undo
                ob= add_object(type);
+               set_active_base(BASACT);
                base_init_from_view3d(BASACT, G.vd);
                
                /* only undo pushes on objects without editmode... */
@@ -1820,14 +1821,13 @@ void docentre(int centremode)
 
                                        allqueue(REDRAWBUTSEDIT, 0);
                                }
-                               base->object->recalc |= OB_RECALC_OB|OB_RECALC_DATA;
+                               DAG_object_flush_update(G.scene, base->object, OB_RECALC_OB|OB_RECALC_DATA);
                        }
                }
                base= base->next;
        }
 
        allqueue(REDRAWVIEW3D, 0);
-       DAG_scene_flush_update(G.scene, screen_view3d_layers());
        BIF_undo_push("Do Centre");     
 }
 
@@ -2619,6 +2619,10 @@ void copy_attr_menu()
        
        if(ob->type == OB_FONT) strcat(str, "|Font Settings%x18|Bevel Settings%x19");
        if(ob->type == OB_CURVE) strcat(str, "|Bevel Settings%x19");
+       
+       if((ob->type == OB_FONT) || (ob->type == OB_CURVE)) {
+                       strcat(str, "|Curve Resolution%x25");
+       }
 
        if(ob->type==OB_MESH){
                strcat(str, "|Subdiv%x21");
@@ -2643,6 +2647,7 @@ void copy_attr(short event)
        Object *ob, *obt;
        Base *base;
        Curve *cu, *cu1;
+       Nurb *nu;
        void *poin1, *poin2=0;
        
        if(G.scene->id.lib) return;
@@ -2782,6 +2787,24 @@ void copy_attr(short event)
                                                base->object->recalc |= OB_RECALC_DATA;
                                        }
                                }
+                               else if(event==25) {    /* curve resolution */
+
+                                       if ELEM(base->object->type, OB_CURVE, OB_FONT) {
+                                               cu= ob->data;
+                                               cu1= base->object->data;
+                                               
+                                               cu1->resolu= cu->resolu;
+                                               
+                                               nu= cu1->nurb.first;
+                                               
+                                               while(nu) {
+                                                       nu->resolu= cu1->resolu;
+                                                       nu= nu->next;
+                                               }
+                                               
+                                               base->object->recalc |= OB_RECALC_DATA;
+                                       }
+                               }
                                else if(event==20) {    /* particle settings */
                                        PartEff *pa1, *pa2;
                                        char *p1, *p2;
@@ -3519,8 +3542,10 @@ void std_rmouse_transform(void (*xf_func)(int, int))
                        PIL_sleep_ms(10);
                        timer++;
                        if(timer>=10*U.tb_rightmouse) {
-                               toolbox_n();
-                               return;
+                               if(curarea->spacetype==SPACE_VIEW3D) {
+                                       toolbox_n();
+                                       return;
+                               }
                        }
                }
        }
@@ -4319,7 +4344,7 @@ void adduplicate(int noTrans)
        /* ipos */
        ipo= G.main->ipo.first;
        while(ipo) {
-               if(ipo->id.lib==NULL) {
+               if(ipo->id.lib==NULL && ipo->id.newid) {
                        IpoCurve *icu;
                        for(icu= ipo->curve.first; icu; icu= icu->next) {
                                if(icu->driver) {