Fix T38471: parenting in the outliner was possible with library linked objects.

This commit is contained in:
Brecht Van Lommel
2014-02-05 13:16:15 +01:00
parent 27d482425d
commit 8acf717b6d

View File

@@ -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);