Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_relations.c
| Show First 20 Lines • Show All 1,075 Lines • ▼ Show 20 Lines | void OBJECT_OT_parent_no_inverse_set(wmOperatorType *ot) | ||||
| ot->invoke = WM_operator_confirm; | ot->invoke = WM_operator_confirm; | ||||
| ot->exec = parent_noinv_set_exec; | ot->exec = parent_noinv_set_exec; | ||||
| ot->poll = ED_operator_object_active_editable; | ot->poll = ED_operator_object_active_editable; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| } | } | ||||
| /************************ Clear Slow Parent Operator *********************/ | |||||
| static int object_slow_parent_clear_exec(bContext *C, wmOperator *UNUSED(op)) | |||||
| { | |||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | |||||
| Scene *scene = CTX_data_scene(C); | |||||
| CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) | |||||
| { | |||||
| if (ob->parent) { | |||||
| if (ob->partype & PARSLOW) { | |||||
| ob->partype -= PARSLOW; | |||||
| BKE_object_where_is_calc(depsgraph, scene, ob); | |||||
| ob->partype |= PARSLOW; | |||||
| DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); | |||||
| } | |||||
| } | |||||
| } | |||||
| CTX_DATA_END; | |||||
| WM_event_add_notifier(C, NC_SCENE, scene); | |||||
| return OPERATOR_FINISHED; | |||||
| } | |||||
| void OBJECT_OT_slow_parent_clear(wmOperatorType *ot) | |||||
| { | |||||
| /* identifiers */ | |||||
| ot->name = "Clear Slow Parent"; | |||||
| ot->description = "Clear the object's slow parent"; | |||||
| ot->idname = "OBJECT_OT_slow_parent_clear"; | |||||
| /* api callbacks */ | |||||
| ot->invoke = WM_operator_confirm; | |||||
| ot->exec = object_slow_parent_clear_exec; | |||||
| ot->poll = ED_operator_view3d_active; | |||||
| /* flags */ | |||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | |||||
| } | |||||
| /********************** Make Slow Parent Operator *********************/ | |||||
| static int object_slow_parent_set_exec(bContext *C, wmOperator *UNUSED(op)) | |||||
| { | |||||
| Scene *scene = CTX_data_scene(C); | |||||
| CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) | |||||
| { | |||||
| if (ob->parent) | |||||
| ob->partype |= PARSLOW; | |||||
| DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); | |||||
| } | |||||
| CTX_DATA_END; | |||||
| WM_event_add_notifier(C, NC_SCENE, scene); | |||||
| return OPERATOR_FINISHED; | |||||
| } | |||||
| void OBJECT_OT_slow_parent_set(wmOperatorType *ot) | |||||
| { | |||||
| /* identifiers */ | |||||
| ot->name = "Set Slow Parent"; | |||||
| ot->description = "Set the object's slow parent"; | |||||
| ot->idname = "OBJECT_OT_slow_parent_set"; | |||||
| /* api callbacks */ | |||||
| ot->invoke = WM_operator_confirm; | |||||
| ot->exec = object_slow_parent_set_exec; | |||||
| ot->poll = ED_operator_view3d_active; | |||||
| /* flags */ | |||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | |||||
| } | |||||
| /* ******************** Clear Track Operator ******************* */ | /* ******************** Clear Track Operator ******************* */ | ||||
| enum { | enum { | ||||
| CLEAR_TRACK = 1, | CLEAR_TRACK = 1, | ||||
| CLEAR_TRACK_KEEP_TRANSFORM = 2, | CLEAR_TRACK_KEEP_TRANSFORM = 2, | ||||
| }; | }; | ||||
| static const EnumPropertyItem prop_clear_track_types[] = { | static const EnumPropertyItem prop_clear_track_types[] = { | ||||
| ▲ Show 20 Lines • Show All 1,466 Lines • Show Last 20 Lines | |||||