diff options
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r-- | source/blender/editors/render/render_shading.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 08a5eddb521..32ad198c1d7 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -722,6 +722,32 @@ static int freestyle_active_lineset_poll(bContext *C) return FRS_get_active_lineset(&srl->freestyleConfig) != NULL; } +static int freestyle_lineset_copy_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay); + + FRS_copy_active_lineset(&srl->freestyleConfig); + + WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); + + return OPERATOR_FINISHED; +} + +void SCENE_OT_freestyle_lineset_copy(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Copy Line Set"; + ot->idname= "SCENE_OT_freestyle_lineset_copy"; + ot->description="Create a copy of the active line set"; + + /* api callbacks */ + ot->exec= freestyle_lineset_copy_exec; + ot->poll= freestyle_active_lineset_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} static int freestyle_lineset_remove_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); |