Fix T38471: parenting in the outliner was possible with library linked objects.
This commit is contained in:
parent
27d482425d
commit
8acf717b6d
Notes:
blender-bot
2023-02-14 11:15:39 +01:00
Referenced by issue #38471, linked objects lose parents on saving or on loading
|
@ -1469,6 +1469,11 @@ static int parent_drop_exec(bContext *C, wmOperator *op)
|
|||
RNA_string_get(op->ptr, "child", childname);
|
||||
ob = (Object *)BKE_libblock_find_name(ID_OB, childname);
|
||||
|
||||
if (ob->id.lib) {
|
||||
BKE_report(op->reports, RPT_INFO, "Can't edit library linked object");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
ED_object_parent_set(op->reports, bmain, scene, ob, par, partype, false, false, NULL);
|
||||
|
||||
DAG_relations_tag_update(bmain);
|
||||
|
@ -1512,6 +1517,10 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
if (ob == par) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
if (ob->id.lib) {
|
||||
BKE_report(op->reports, RPT_INFO, "Can't edit library linked object");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
scene = (Scene *)outliner_search_back(soops, te, ID_SCE);
|
||||
|
||||
|
|
Loading…
Reference in New Issue