Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_modifier.c
| Show First 20 Lines • Show All 504 Lines • ▼ Show 20 Lines | else { | ||||
| /* Move modifier up in list. */ | /* Move modifier up in list. */ | ||||
| for (; md_index > index; md_index--) { | for (; md_index > index; md_index--) { | ||||
| if (!ED_object_modifier_move_up(reports, ob, md)) { | if (!ED_object_modifier_move_up(reports, ob, md)) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | |||||
| WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); | |||||
| return true; | return true; | ||||
| } | } | ||||
| void ED_object_modifier_link(bContext *C, Object *ob_dst, Object *ob_src) | |||||
| { | |||||
| BKE_object_link_modifiers(ob_dst, ob_src); | |||||
| WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob_dst); | |||||
| DEG_id_tag_update(&ob_dst->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); | |||||
| } | |||||
| void ED_object_modifier_copy_to_object(Object *ob_dst, Object *ob_src, ModifierData *md) | |||||
| { | |||||
| BKE_object_copy_modifier(ob_dst, ob_src, md); | |||||
| WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob_dst); | |||||
| DEG_id_tag_update(&ob_dst->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); | |||||
| } | |||||
| bool ED_object_modifier_convert(ReportList *UNUSED(reports), | bool ED_object_modifier_convert(ReportList *UNUSED(reports), | ||||
| Main *bmain, | Main *bmain, | ||||
| Depsgraph *depsgraph, | Depsgraph *depsgraph, | ||||
| ViewLayer *view_layer, | ViewLayer *view_layer, | ||||
| Object *ob, | Object *ob, | ||||
| ModifierData *md) | ModifierData *md) | ||||
| { | { | ||||
| Object *obn; | Object *obn; | ||||
| ▲ Show 20 Lines • Show All 771 Lines • ▼ Show 20 Lines | static int modifier_move_to_index_exec(bContext *C, wmOperator *op) | ||||
| Object *ob = ED_object_active_context(C); | Object *ob = ED_object_active_context(C); | ||||
| ModifierData *md = edit_modifier_property_get(op, ob, 0); | ModifierData *md = edit_modifier_property_get(op, ob, 0); | ||||
| int index = RNA_int_get(op->ptr, "index"); | int index = RNA_int_get(op->ptr, "index"); | ||||
| if (!ED_object_modifier_move_to_index(op->reports, ob, md, index)) { | if (!ED_object_modifier_move_to_index(op->reports, ob, md, index)) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); | |||||
| WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static int modifier_move_to_index_invoke(bContext *C, wmOperator *op, const wmEvent *event) | static int modifier_move_to_index_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| { | { | ||||
| int retval; | int retval; | ||||
| if (edit_modifier_invoke_properties(C, op, event, &retval)) { | if (edit_modifier_invoke_properties(C, op, event, &retval)) { | ||||
| return modifier_move_to_index_exec(C, op); | return modifier_move_to_index_exec(C, op); | ||||
| ▲ Show 20 Lines • Show All 1,708 Lines • Show Last 20 Lines | |||||