Fix T88954: Rearranging of modifiers for linked objects no longer works.

There would be no modifier set in context in drag and drop case, in that
case try to get active modifier from active object instead.
This commit is contained in:
Bastien Montagne 2021-09-29 12:52:48 +02:00
parent 0c32e3b312
commit 6351c73b75
Notes: blender-bot 2023-02-14 02:58:19 +01:00
Referenced by issue #88954, Rearranging of modifiers for linked objects no longer works
1 changed files with 6 additions and 2 deletions

View File

@ -1044,6 +1044,10 @@ bool edit_modifier_poll_generic(bContext *C,
Object *ob = (ptr.owner_id) ? (Object *)ptr.owner_id : ED_object_active_context(C);
ModifierData *mod = ptr.data; /* May be NULL. */
if (mod == NULL && ob != NULL) {
mod = BKE_object_active_modifier(ob);
}
if (!ob || ID_IS_LINKED(ob)) {
return false;
}
@ -1923,8 +1927,8 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
const eMultiresSubdivideModeType subdivide_mode = (eMultiresSubdivideModeType)(RNA_enum_get(
op->ptr, "mode"));
const eMultiresSubdivideModeType subdivide_mode = (eMultiresSubdivideModeType)(
RNA_enum_get(op->ptr, "mode"));
multiresModifier_subdivide(object, mmd, subdivide_mode);
ED_object_iter_other(