diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-07-19 13:52:32 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-08-12 05:10:36 +0400 |
commit | 34c133a488bdd78a1bd5027e1dcc8c60da86d25a (patch) | |
tree | 6cc5822b6a0fc79b9d8ae0fdb75a3cebf6fa6080 /source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp | |
parent | c38e80d6322b942fd2a893f4f294a919ed6e6b99 (diff) |
Freestyle: an improved workflow of line style shading nodes.
Removed the previous changes for passing a line style through the Controller, and
revised the BlenderTextureShader to assign the shader node tree of a line style
(if specified) to strokes. This way the assignment of shading nodes can be done
through both the Freestyle GUI and Python scripting.
Diffstat (limited to 'source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp index f6557445d48..c4df9c5d716 100644 --- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp @@ -50,7 +50,6 @@ extern "C" { #include "BKE_library.h" #include "BKE_linestyle.h" #include "BKE_main.h" -#include "BKE_scene.h" #include "BKE_text.h" #include "BKE_context.h" @@ -295,8 +294,6 @@ static bool test_edge_type_conditions(struct edge_type_condition *conditions, static void prepare(Main *bmain, Render *re, SceneRenderLayer *srl) { - const bool use_shading_nodes = BKE_scene_use_new_shading_nodes(re->scene); - // load mesh re->i.infostr = "Freestyle: Mesh loading"; re->stats_draw(re->sdh, &re->i); @@ -331,7 +328,7 @@ static void prepare(Main *bmain, Render *re, SceneRenderLayer *srl) cout << " (" << module_conf->script->name << ")"; cout << endl; } - controller->InsertStyleModule(layer_count, id_name, module_conf->script, NULL, use_shading_nodes); + controller->InsertStyleModule(layer_count, id_name, module_conf->script); controller->toggleLayer(layer_count, true); layer_count++; } @@ -372,7 +369,7 @@ static void prepare(Main *bmain, Render *re, SceneRenderLayer *srl) (lineset->linestyle ? (lineset->linestyle->id.name + 2) : "<NULL>") << endl; } Text *text = create_lineset_handler(bmain, srl->name, lineset->name); - controller->InsertStyleModule(layer_count, lineset->name, text, lineset->linestyle, use_shading_nodes); + controller->InsertStyleModule(layer_count, lineset->name, text); controller->toggleLayer(layer_count, true); if (!(lineset->selection & FREESTYLE_SEL_EDGE_TYPES) || !lineset->edge_types) { ++use_ridges_and_valleys; @@ -743,8 +740,9 @@ Material *FRS_create_stroke_material(bContext *C, Main *bmain, Scene *scene) if (!linestyle) { cout << "FRS_create_stroke_material: No active line style in the current scene" << endl; + return NULL; } - return BlenderStrokeRenderer::GetStrokeShader(C, bmain, linestyle); + return BlenderStrokeRenderer::GetStrokeShader(C, bmain, linestyle->nodetree); } } // extern "C" |