Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_ops.c
| Show All 39 Lines | |||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "DNA_view3d_types.h" | #include "DNA_view3d_types.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_appdir.h" | #include "BKE_appdir.h" | ||||
| #include "BKE_blender_copybuffer.h" | #include "BKE_blender_copybuffer.h" | ||||
| #include "BKE_collection.h" | |||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_group.h" | |||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| Show All 18 Lines | static int view3d_copybuffer_exec(bContext *C, wmOperator *op) | ||||
| /* context, selection, could be generalized */ | /* context, selection, could be generalized */ | ||||
| CTX_DATA_BEGIN (C, Object *, ob, selected_objects) | CTX_DATA_BEGIN (C, Object *, ob, selected_objects) | ||||
| { | { | ||||
| BKE_copybuffer_tag_ID(&ob->id); | BKE_copybuffer_tag_ID(&ob->id); | ||||
| } | } | ||||
| CTX_DATA_END; | CTX_DATA_END; | ||||
| for (Group *group = bmain->group.first; group; group = group->id.next) { | for (Collection *collection = bmain->collection.first; collection; collection = collection->id.next) { | ||||
| FOREACH_GROUP_OBJECT_BEGIN(group, object) | for (CollectionObject *cob = collection->gobject.first; cob; cob = cob->next) { | ||||
| { | Object *object = cob->ob; | ||||
| if (object && (object->id.tag & LIB_TAG_DOIT)) { | if (object && (object->id.tag & LIB_TAG_DOIT)) { | ||||
| BKE_copybuffer_tag_ID(&group->id); | BKE_copybuffer_tag_ID(&collection->id); | ||||
| /* don't expand out to all other objects */ | /* don't expand out to all other objects */ | ||||
| group->id.tag &= ~LIB_TAG_NEED_EXPAND; | collection->id.tag &= ~LIB_TAG_NEED_EXPAND; | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| FOREACH_GROUP_OBJECT_END; | |||||
| } | } | ||||
| BLI_make_file_string("/", str, BKE_tempdir_base(), "copybuffer.blend"); | BLI_make_file_string("/", str, BKE_tempdir_base(), "copybuffer.blend"); | ||||
| BKE_copybuffer_save(bmain, str, op->reports); | BKE_copybuffer_save(bmain, str, op->reports); | ||||
| BKE_report(op->reports, RPT_INFO, "Copied selected objects to buffer"); | BKE_report(op->reports, RPT_INFO, "Copied selected objects to buffer"); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| ▲ Show 20 Lines • Show All 445 Lines • Show Last 20 Lines | |||||