diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-09-22 17:01:51 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-09-22 17:01:51 +0400 |
commit | c79f99224dbfd046e84cbfccc74580ed4220859b (patch) | |
tree | dad86ae100af51086e5e847484535c53df525e0e /source/blender/src/editobject.c | |
parent | a6edcfc4ac46b8d649a73b7271ed7b238ebcb3a9 (diff) |
Bugfix #14428: Constraints lost when object made single user
When there was a setup where an object was linked to more than one scene at once, and in one of those scenes some of the objects in that scene were related to it, the objects related to it were not correctly relinked to the new copy.
This was due to the 2nd check for selected objects
if( (base->flag & flag)==flag)
meaning that only selected objects would get corrected.
Diffstat (limited to 'source/blender/src/editobject.c')
-rw-r--r-- | source/blender/src/editobject.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 67709357225..a52882e6003 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -4381,18 +4381,17 @@ void single_object_users(int flag) clear_sca_new_poins(); /* sensor/contr/act */ - /* duplicate */ + /* duplicate (must set newid) */ base= FIRSTBASE; while(base) { ob= base->object; - if( (base->flag & flag)==flag) { - + if( (base->flag & flag)==flag ) { if(ob->id.lib==NULL && ob->id.us>1) { - + /* base gets copy of object */ obn= copy_object(ob); - ob->id.us--; base->object= obn; + ob->id.us--; } } base= base->next; @@ -4406,20 +4405,17 @@ void single_object_users(int flag) while(base) { ob= base->object; if(ob->id.lib==NULL) { - if( (base->flag & flag)==flag) { - - relink_constraints(&base->object->constraints); - if (base->object->pose){ - bPoseChannel *chan; - for (chan = base->object->pose->chanbase.first; chan; chan=chan->next){ - relink_constraints(&chan->constraints); - } + relink_constraints(&base->object->constraints); + if (base->object->pose){ + bPoseChannel *chan; + for (chan = base->object->pose->chanbase.first; chan; chan=chan->next){ + relink_constraints(&chan->constraints); } - modifiers_foreachObjectLink(base->object, single_object_users__forwardModifierLinks, NULL); - - ID_NEW(ob->parent); - ID_NEW(ob->track); } + modifiers_foreachObjectLink(base->object, single_object_users__forwardModifierLinks, NULL); + + ID_NEW(ob->parent); + ID_NEW(ob->track); } base= base->next; } |