Orange bugfix:

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!)
This commit is contained in:
Ton Roosendaal 2006-01-09 12:18:42 +00:00
parent 96596d4ced
commit b9eabd976d

@ -4424,20 +4424,6 @@ void adduplicate(int mode, int dupflag)
base= base->next; 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 */ /* materials */
if( dupflag & USER_DUP_MAT) { if( dupflag & USER_DUP_MAT) {
mao= G.main->mat.first; 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_sort(G.scene);
DAG_scene_flush_update(G.scene, screen_view3d_layers()); DAG_scene_flush_update(G.scene, screen_view3d_layers());
set_sca_new_poins(); set_sca_new_poins();