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:
-rw-r--r--source/blender/editors/render/render_shading.c8
-rw-r--r--source/blender/freestyle/FRS_freestyle.h3
-rw-r--r--source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp11
3 files changed, 11 insertions, 11 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;
}
diff --git a/source/blender/freestyle/FRS_freestyle.h b/source/blender/freestyle/FRS_freestyle.h
index c3bf854447c..3777f8dfd49 100644
--- a/source/blender/freestyle/FRS_freestyle.h
+++ b/source/blender/freestyle/FRS_freestyle.h
@@ -32,6 +32,7 @@ extern "C" {
struct Render;
struct Material;
struct FreestyleConfig;
+struct FreestyleLineStyle;
struct bContext;
extern struct Scene *freestyle_scene;
@@ -59,7 +60,7 @@ void FRS_move_active_lineset_up(struct FreestyleConfig *config);
void FRS_move_active_lineset_down(struct FreestyleConfig *config);
/* Testing */
-struct Material *FRS_create_stroke_material(struct bContext *C, struct Main *bmain, struct Scene *scene);
+struct Material *FRS_create_stroke_material(struct bContext *C, struct Main *bmain, struct FreestyleLineStyle *linestyle);
#ifdef __cplusplus
}
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
index 1c8df35cb3e..bba4f58b922 100644
--- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
+++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
@@ -735,16 +735,9 @@ void FRS_move_active_lineset_down(FreestyleConfig *config)
// Testing
-Material *FRS_create_stroke_material(bContext *C, Main *bmain, Scene *scene)
+Material *FRS_create_stroke_material(bContext *C, Main *bmain, struct FreestyleLineStyle *linestyle)
{
- FreestyleLineStyle *linestyle = BKE_linestyle_active_from_scene(scene);
- Material *ma;
-
- if (!linestyle) {
- cout << "FRS_create_stroke_material: No active line style in the current scene" << endl;
- return NULL;
- }
- ma = BlenderStrokeRenderer::GetStrokeShader(C, bmain, linestyle->nodetree, true);
+ Material *ma = BlenderStrokeRenderer::GetStrokeShader(C, bmain, linestyle->nodetree, true);
ma->id.us = 0;
return ma;
}