Orange bugfix:
authorTon Roosendaal <ton@blender.org>
Mon, 9 Jan 2006 12:18:42 +0000 (12:18 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 9 Jan 2006 12:18:42 +0000 (12:18 +0000)
On duplicating an object with material ipos that has drivers, the new ipos
(if material and ipos were copied) didn't get the correct pointer to the
new driver object (if that was copied!)

source/blender/src/editobject.c

index 5c3655094cc744444cef12d83c3aadffc3baf8ee..dcf2769c8d5b872743894034c72a4fd67b0c8e64 100644 (file)
@@ -4424,20 +4424,6 @@ void adduplicate(int mode, int dupflag)
                base= base->next;
        }
        
-       /* ipos */
-       ipo= G.main->ipo.first;
-       while(ipo) {
-               if(ipo->id.lib==NULL && ipo->id.newid) {
-                       IpoCurve *icu;
-                       for(icu= ipo->curve.first; icu; icu= icu->next) {
-                               if(icu->driver) {
-                                       ID_NEW(icu->driver->ob);
-                               }
-                       }
-               }
-               ipo= ipo->id.next;
-       }
-       
        /* materials */
        if( dupflag & USER_DUP_MAT) {
                mao= G.main->mat.first;
@@ -4469,6 +4455,23 @@ void adduplicate(int mode, int dupflag)
                }
        }
 
+       /* ipos */
+       ipo= G.main->ipo.first;
+       while(ipo) {
+               if(ipo->id.lib==NULL && ipo->id.newid) {
+                       Ipo *ipon= (Ipo *)ipo->id.newid;
+                       IpoCurve *icu;
+                       for(icu= ipon->curve.first; icu; icu= icu->next) {
+                               if(icu->driver) {
+                                       ID_NEW(icu->driver->ob);
+                               }
+                       }
+               }
+               ipo= ipo->id.next;
+       }
+
+
+
        DAG_scene_sort(G.scene);
        DAG_scene_flush_update(G.scene, screen_view3d_layers());
        set_sca_new_poins();