Fix assigning material to linked object being forbidden in BKE.

While this should not be allowed in general, there are some cases
(library overrides at least) where supporting this is mandatory.

Further more, comment stating that this could crash is from 2011, could
not reproduce any issue with current code. Commit comment was referring
to undo/redo, but in use cases here those should not affect things.

Note that in general, such relatively high-level checks should be
handled by high-level, close to user code (like in ED area e.g.), not in
low-level BKE code anyway.
This commit is contained in:
Bastien Montagne 2021-06-09 16:01:14 +02:00
parent 5954b351f0
commit 92ae3ff84c
1 changed files with 0 additions and 6 deletions

View File

@ -969,12 +969,6 @@ void BKE_object_material_assign(Main *bmain, Object *ob, Material *ma, short act
act = 1;
}
/* prevent crashing when using accidentally */
BLI_assert(!ID_IS_LINKED(ob));
if (ID_IS_LINKED(ob)) {
return;
}
/* test arraylens */
totcolp = BKE_object_material_len_p(ob);