Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-07-20 15:09:46 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-08-12 05:10:44 +0400
commit2843aa1501c5aabebe1701c88cd30b501e6b4aa5 (patch)
treebc3bb5aa825f63c73e4f6264ad1851fd52088437 /source/blender/editors/render/render_shading.c
parentcc33d731856560896362f94d11cb16f66ca4d3d7 (diff)
Freestyle: Fix for error handling in SCENE_OT_freestyle_stroke_material_create.
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r--source/blender/editors/render/render_shading.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 021e4aaf339..5c3bd8f9eae 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -1254,8 +1254,14 @@ static int freestyle_stroke_material_create_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
+ FreestyleLineStyle *linestyle = BKE_linestyle_active_from_scene(scene);
- FRS_create_stroke_material(C, bmain, scene);
+ if (!linestyle) {
+ BKE_report(op->reports, RPT_ERROR, "No active line style in the current scene");
+ return OPERATOR_CANCELLED;
+ }
+
+ FRS_create_stroke_material(C, bmain, linestyle);
return OPERATOR_FINISHED;
}