Fix T41467: Modifier view buttons changing positions.
Commits early in this year (to save some space) broke this. Hopefully this time it works in all cases - lastCageIndex is no more influenced by realtime/edit active states. Also, inactivate buttons instead of hiding them, can be useful to set those data even though it does not have any immediate effect. Took the opportunity to switch cage buttons to RNA, btw.
This commit is contained in:
@@ -353,6 +353,7 @@ int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *r_lastPossibleC
|
||||
/* Find the last modifier acting on the cage. */
|
||||
for (i = 0; md; i++, md = md->next) {
|
||||
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
|
||||
bool supports_mapping;
|
||||
|
||||
md->scene = scene;
|
||||
|
||||
@@ -360,16 +361,17 @@ int modifiers_getCageIndex(struct Scene *scene, Object *ob, int *r_lastPossibleC
|
||||
if (!(mti->flags & eModifierTypeFlag_SupportsEditmode)) continue;
|
||||
if (md->mode & eModifierMode_DisableTemporary) continue;
|
||||
|
||||
supports_mapping = modifier_supportsMapping(md);
|
||||
if (r_lastPossibleCageIndex && supports_mapping) {
|
||||
*r_lastPossibleCageIndex = i;
|
||||
}
|
||||
|
||||
if (!(md->mode & eModifierMode_Realtime)) continue;
|
||||
if (!(md->mode & eModifierMode_Editmode)) continue;
|
||||
|
||||
if (!modifier_supportsMapping(md))
|
||||
if (!supports_mapping)
|
||||
break;
|
||||
|
||||
if (r_lastPossibleCageIndex) {
|
||||
*r_lastPossibleCageIndex = i;
|
||||
}
|
||||
|
||||
if (md->mode & eModifierMode_OnCage)
|
||||
cageIndex = i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user