diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-03-09 06:23:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-03-09 06:33:27 +0300 |
commit | ec180218678be5704d31532fff8c20d2356b8f02 (patch) | |
tree | 814d96d292cc32d51c9c8fd0bac0951dd262517c /source/blender/blenloader | |
parent | 573783259dcd852c56f7a56eb0e2284e8b56b352 (diff) |
Fix T43337: Group object disappear after append
Relying on user-count of 1 wasn't reliable because of custom-bones.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ceccb7387da..45d1c2038c2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9045,7 +9045,7 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const do_it = true; } else if (idcode==ID_GR) { - if (ob->id.us == 1 && is_link == false && ob->id.lib == lib) { + if ((is_link == false) && (ob->id.lib == lib)) { if ((ob->flag & OB_FROMGROUP) && object_in_any_scene(mainvar, ob)==0) { do_it = true; } @@ -9054,7 +9054,7 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const else { /* when appending, make sure any indirectly loaded objects * get a base else they cant be accessed at all [#27437] */ - if (ob->id.us==1 && is_link == false && ob->id.lib == lib) { + if ((is_link == false) && (ob->id.lib == lib)) { /* we may be appending from a scene where we already * have a linked object which is not in any scene [#27616] */ if ((ob->id.flag & LIB_PRE_EXISTING)==0) { @@ -9074,7 +9074,9 @@ static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const base->lay = ob->lay; base->object = ob; base->flag = ob->flag; - ob->id.us = 1; + + CLAMP_MIN(ob->id.us, 0); + ob->id.us += 1; ob->id.flag -= LIB_INDIRECT; ob->id.flag |= LIB_EXTERN; |