Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_relations.c
| Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_group.h" | #include "BKE_group.h" | ||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_lamp.h" | #include "BKE_lamp.h" | ||||
| #include "BKE_lattice.h" | #include "BKE_lattice.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_library_override.h" | |||||
| #include "BKE_library_query.h" | #include "BKE_library_query.h" | ||||
| #include "BKE_library_remap.h" | #include "BKE_library_remap.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "BKE_mball.h" | #include "BKE_mball.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #include "BKE_modifier.h" | #include "BKE_modifier.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| ▲ Show 20 Lines • Show All 2,232 Lines • ▼ Show 20 Lines | void OBJECT_OT_make_local(wmOperatorType *ot) | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* properties */ | /* properties */ | ||||
| ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); | ot->prop = RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); | ||||
| } | } | ||||
| static int make_override_exec(bContext *C, wmOperator *UNUSED(op)) | |||||
| { | |||||
| Main *bmain = CTX_data_main(C); | |||||
| Object *locobj, *refobj = CTX_data_active_object(C); | |||||
| locobj = (Object *)BKE_override_static_create_from(bmain, &refobj->id); | |||||
| WM_event_add_notifier(C, NC_WINDOW, NULL); | |||||
| return OPERATOR_FINISHED; | |||||
| } | |||||
| static int make_override_poll(bContext *C) | |||||
| { | |||||
| Object *obact = CTX_data_active_object(C); | |||||
| /* Object must be directly linked to be overridable. */ | |||||
| return (ED_operator_objectmode(C) && obact && obact->id.lib != NULL && obact->id.tag & LIB_TAG_EXTERN); | |||||
| } | |||||
| void OBJECT_OT_make_override(wmOperatorType *ot) | |||||
| { | |||||
| /* identifiers */ | |||||
| ot->name = "Make Override"; | |||||
| ot->description = "Make local override of this library linked data-block"; | |||||
| ot->idname = "OBJECT_OT_make_override"; | |||||
| /* api callbacks */ | |||||
| ot->exec = make_override_exec; | |||||
| ot->poll = make_override_poll; | |||||
| /* flags */ | |||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | |||||
| /* properties */ | |||||
| } | |||||
| enum { | enum { | ||||
| MAKE_SINGLE_USER_ALL = 1, | MAKE_SINGLE_USER_ALL = 1, | ||||
| MAKE_SINGLE_USER_SELECTED = 2, | MAKE_SINGLE_USER_SELECTED = 2, | ||||
| }; | }; | ||||
| static int make_single_user_exec(bContext *C, wmOperator *op) | static int make_single_user_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| ▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines | |||||