== 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).
This commit is contained in:
Martin Poirier 2007-12-21 01:53:55 +00:00
parent 6135f97105
commit 1a475f0dfc
2 changed files with 17 additions and 9 deletions

@ -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

@ -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);