Another Proxy Armature bugfix:
authorTon Roosendaal <ton@blender.org>
Sun, 2 Dec 2007 18:33:14 +0000 (18:33 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 2 Dec 2007 18:33:14 +0000 (18:33 +0000)
- Library referencing didn't add the new local Ipo for constraints
- Proxy command didn't set the driver object in constraint ipo to be
  the new proxy object.

source/blender/blenkernel/intern/object.c
source/blender/blenloader/intern/readfile.c

index 3c815e86116c921206bcd370dd01cdf65289d443..b94e47492b22991370ec5ef6b9df5856533a2c19 100644 (file)
@@ -1037,7 +1037,7 @@ static void copy_object_pose(Object *obn, Object *ob)
 {
        bPoseChannel *chan;
        
-       copy_pose(&obn->pose, ob->pose, 1);
+       copy_pose(&obn->pose, ob->pose, 1);     /* 1 = copy constraints */
 
        for (chan = obn->pose->chanbase.first; chan; chan=chan->next){
                bConstraint *con;
@@ -1049,6 +1049,14 @@ static void copy_object_pose(Object *obn, Object *ob)
                        ListBase targets = {NULL, NULL};
                        bConstraintTarget *ct;
                        
+                       if(con->ipo) {
+                               IpoCurve *icu;
+                               for(icu= con->ipo->curve.first; icu; icu= icu->next) {
+                                       if(icu->driver && icu->driver->ob==ob)
+                                               icu->driver->ob= obn;
+                               }
+                       }
+                       
                        if (cti && cti->get_constraint_targets) {
                                cti->get_constraint_targets(con, &targets);
                                
@@ -1302,6 +1310,7 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
        
        /* skip constraints, constraintchannels, nla? */
        
+       
        ob->type= target->type;
        ob->data= target->data;
        id_us_plus((ID *)ob->data);             /* ensures lib data becomes LIB_EXTERN */
index 678e2da276f9b66fa2a886bb805a7912ce65b786..b67cdc61dc62a5babe3a5dd5c02f8ba00c380841 100644 (file)
@@ -7585,6 +7585,10 @@ static void expand_constraints(FileData *fd, Main *mainvar, ListBase *lb)
        bConstraint *curcon;
 
        for (curcon=lb->first; curcon; curcon=curcon->next) {
+               
+               if (curcon->ipo)
+                       expand_doit(fd, mainvar, curcon->ipo);
+               
                switch (curcon->type) {
                case CONSTRAINT_TYPE_NULL:
                        break;