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/freestyle
parentcc33d731856560896362f94d11cb16f66ca4d3d7 (diff)
Freestyle: Fix for error handling in SCENE_OT_freestyle_stroke_material_create.
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r--source/blender/freestyle/FRS_freestyle.h3
-rw-r--r--source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp11
2 files changed, 4 insertions, 10 deletions
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;
}