Plumiferos request; additional option for subsurf hotkey.

Now alt+shift+o only toggles the 3d view subsurf flag, rendering remains
subsurfed.
This commit is contained in:
Ton Roosendaal 2006-11-16 10:36:45 +00:00
parent 24b2e0422e
commit c1e4099365
2 changed files with 13 additions and 7 deletions

@ -2713,7 +2713,7 @@ void convertmenu(void)
* level==-1 then toggle subsurf, else set to level. * level==-1 then toggle subsurf, else set to level.
* *set allows to toggle multiple selections * *set allows to toggle multiple selections
*/ */
static void object_flip_subdivison(Object *ob, int *set, int level) static void object_flip_subdivison(Object *ob, int *set, int level, int mode)
{ {
ModifierData *md; ModifierData *md;
@ -2727,12 +2727,12 @@ static void object_flip_subdivison(Object *ob, int *set, int level)
if (level == -1) { if (level == -1) {
if(*set == -1) if(*set == -1)
*set= smd->modifier.mode&(eModifierMode_Render|eModifierMode_Realtime); *set= smd->modifier.mode&(mode);
if (*set) { if (*set) {
smd->modifier.mode &= ~(eModifierMode_Render|eModifierMode_Realtime); smd->modifier.mode &= ~(mode);
} else { } else {
smd->modifier.mode |= (eModifierMode_Render|eModifierMode_Realtime); smd->modifier.mode |= (mode);
} }
} else { } else {
smd->levels = level; smd->levels = level;
@ -2761,14 +2761,20 @@ void flip_subdivison(int level)
{ {
Base *base; Base *base;
int set= -1; int set= -1;
int mode;
if(G.qual & LR_ALTKEY)
mode= eModifierMode_Realtime;
else
mode= eModifierMode_Render|eModifierMode_Realtime;
for(base= G.scene->base.first; base; base= base->next) { for(base= G.scene->base.first; base; base= base->next) {
if(TESTBASE(base)) { if(TESTBASE(base)) {
object_flip_subdivison(base->object, &set, level); object_flip_subdivison(base->object, &set, level, mode);
if(base->object->dup_group) { if(base->object->dup_group) {
GroupObject *go; GroupObject *go;
for(go= base->object->dup_group->gobject.first; go; go= go->next) for(go= base->object->dup_group->gobject.first; go; go= go->next)
object_flip_subdivison(go->ob, &set, level); object_flip_subdivison(go->ob, &set, level, mode);
} }
} }
} }

@ -1727,7 +1727,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
allqueue(REDRAWHEADERS, 0); allqueue(REDRAWHEADERS, 0);
} }
} }
else if((G.qual==LR_SHIFTKEY)) { else if((G.qual==LR_SHIFTKEY || G.qual==(LR_ALTKEY|LR_SHIFTKEY))) {
flip_subdivison(-1); flip_subdivison(-1);
} }
else if(G.qual==LR_ALTKEY) { else if(G.qual==LR_ALTKEY) {