Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_dragdrop.c
| Show First 20 Lines • Show All 807 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (wmDragID *, drag_id, &drag->ids) { | ||||
| /* Ctrl enables linking, so we don't need a from collection then. */ | /* Ctrl enables linking, so we don't need a from collection then. */ | ||||
| Collection *from = (event->ctrl) ? NULL : collection_parent_from_ID(drag_id->from_parent); | Collection *from = (event->ctrl) ? NULL : collection_parent_from_ID(drag_id->from_parent); | ||||
| if (GS(drag_id->id->name) == ID_OB) { | if (GS(drag_id->id->name) == ID_OB) { | ||||
| /* Move/link object into collection. */ | /* Move/link object into collection. */ | ||||
| Object *object = (Object *)drag_id->id; | Object *object = (Object *)drag_id->id; | ||||
| if (from) { | if (from) { | ||||
| BKE_collection_object_move(bmain, scene, data.to, from, object); | BKE_collection_object_move(bmain, scene, data.to, from, object, CTX_data_view_layer(C)); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_collection_object_add(bmain, data.to, object); | BKE_collection_object_add(bmain, data.to, object); | ||||
| } | } | ||||
| } | } | ||||
| else if (GS(drag_id->id->name) == ID_GR) { | else if (GS(drag_id->id->name) == ID_GR) { | ||||
| /* Move/link collection into collection. */ | /* Move/link collection into collection. */ | ||||
| Collection *collection = (Collection *)drag_id->id; | Collection *collection = (Collection *)drag_id->id; | ||||
| ▲ Show 20 Lines • Show All 196 Lines • Show Last 20 Lines | |||||