Static Override: Lock 'edition' of constraints & modifiers from overridden data.
Means that you cannot move or delete constraints/modifiers coming from the overriden linked datablock. Local inserted ones can be fully edited.
This commit is contained in:
parent
0fb5a39baf
commit
7d384bcdbb
|
@ -598,6 +598,11 @@ static int edit_constraint_poll_generic(bContext *C, StructRNA *rna_type)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (ID_IS_STATIC_OVERRIDE(ob)) {
|
||||
CTX_wm_operator_poll_msg_set(C, "Cannot edit constraints comming from static override");
|
||||
return (((bConstraint *)ptr.data)->flag & CONSTRAINT_STATICOVERRIDE_LOCAL) != 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -825,9 +825,19 @@ int edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag
|
|||
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", rna_type);
|
||||
Object *ob = (ptr.id.data) ? ptr.id.data : ED_object_active_context(C);
|
||||
|
||||
if (!ptr.data) {
|
||||
CTX_wm_operator_poll_msg_set(C, "Context missing 'modifier'");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!ob || ID_IS_LINKED(ob)) return 0;
|
||||
if (obtype_flag && ((1 << ob->type) & obtype_flag) == 0) return 0;
|
||||
if (ptr.id.data && ID_IS_LINKED(ptr.id.data)) return 0;
|
||||
|
||||
if (ID_IS_STATIC_OVERRIDE(ob)) {
|
||||
CTX_wm_operator_poll_msg_set(C, "Cannot edit modifiers comming from static override");
|
||||
return (((ModifierData *)ptr.data)->flag & eModifierFlag_StaticOverride_Local) != 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue