From 1a475f0dfc3c76021579c140c9840a61cc0bac11 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Fri, 21 Dec 2007 01:53:55 +0000 Subject: [PATCH] == Transform feature test == Related to bug [#7792] ("Around Selection" user preference doesn't work for linked objects), this commit makes Linked objects be considered in Transform. This has a couple of effects: Linked objects are used to calculate the center of transformation and such but are skipped during the actual transformation. Linked objects can be used as orbiting targets (see previously mentionned bug). The offshot is that selecting a linked object and hitting G doesn't cancel immediately as it did before (this could eventually be worked around, but I don't think it's that much of a problem. Disagreeing people should express themselves). --- source/blender/src/transform_conversions.c | 21 ++++++++++++++------- source/blender/src/transform_generics.c | 5 +++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 405168f6654..ac13634532b 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -3368,19 +3368,21 @@ static void createTransObject(TransInfo *t) /* count */ for(base= FIRSTBASE; base; base= base->next) { - if TESTBASELIB(base) { + if TESTBASE(base) { ob= base->object; /* store ipo keys? */ - if(ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) { + if (ob->id.lib == 0 && ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) { elems.first= elems.last= NULL; make_ipokey_transform(ob, &elems, 1); /* '1' only selected keys */ pushdata(&elems, sizeof(ListBase)); - for(ik= elems.first; ik; ik= ik->next) t->total++; + for(ik= elems.first; ik; ik= ik->next) + t->total++; - if(elems.first==NULL) t->total++; + if(elems.first==NULL) + t->total++; } else { t->total++; @@ -3398,15 +3400,20 @@ static void createTransObject(TransInfo *t) tx = t->ext = MEM_callocN(t->total*sizeof(TransDataExtension), "TransObExtension"); for(base= FIRSTBASE; base; base= base->next) { - if TESTBASELIB(base) { + if TESTBASE(base) { ob= base->object; - td->flag= TD_SELECTED; + td->flag = TD_SELECTED; td->protectflag= ob->protectflag; td->ext = tx; + /* select linked objects, but skip them later */ + if (ob->id.lib != 0) { + td->flag |= TD_SKIP; + } + /* store ipo keys? */ - if(ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) { + if(ob->id.lib == 0 && ob->ipo && ob->ipo->showkey && (ob->ipoflag & OB_DRAWKEY)) { popfirst(&elems); // bring back pushed listbase diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c index d0ca1f4cd74..b24f9bea48d 100644 --- a/source/blender/src/transform_generics.c +++ b/source/blender/src/transform_generics.c @@ -190,8 +190,9 @@ static void clipMirrorModifier(TransInfo *t, Object *ob) break; if (td->loc==NULL) break; - if (td->flag & TD_SKIP) - continue; + + if (td->flag & TD_SKIP) + continue; VecCopyf(loc, td->loc); VecCopyf(iloc, td->iloc);