Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_gpencil_modifier.c
| Show First 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | int ED_object_gpencil_modifier_copy(ReportList *reports, Object *ob, GpencilModifierData *md) | ||||
| nmd = BKE_gpencil_modifier_new(md->type); | nmd = BKE_gpencil_modifier_new(md->type); | ||||
| BKE_gpencil_modifier_copydata(md, nmd); | BKE_gpencil_modifier_copydata(md, nmd); | ||||
| BLI_insertlinkafter(&ob->greasepencil_modifiers, md, nmd); | BLI_insertlinkafter(&ob->greasepencil_modifiers, md, nmd); | ||||
| BKE_gpencil_modifier_unique_name(&ob->greasepencil_modifiers, nmd); | BKE_gpencil_modifier_unique_name(&ob->greasepencil_modifiers, nmd); | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| void ED_object_gpencil_modifier_copy_to_object(Object *ob_dst, GpencilModifierData *md) | |||||
| { | |||||
| BKE_object_copy_gpencil_modifier(ob_dst, 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); | |||||
| } | |||||
| /************************ add modifier operator *********************/ | /************************ add modifier operator *********************/ | ||||
| static int gpencil_modifier_add_exec(bContext *C, wmOperator *op) | static int gpencil_modifier_add_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Object *ob = ED_object_active_context(C); | Object *ob = ED_object_active_context(C); | ||||
| int type = RNA_enum_get(op->ptr, "type"); | int type = RNA_enum_get(op->ptr, "type"); | ||||
| ▲ Show 20 Lines • Show All 495 Lines • Show Last 20 Lines | |||||