diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-05 18:16:09 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-05 20:57:26 +0300 |
commit | 354f92a49458795c69f857de927c5b1531cd3618 (patch) | |
tree | 683f2cc9951a9d1b40ae616f235565205c42c4f9 /source/blender/freestyle/intern | |
parent | a8a77609d3bd2555f72eed1acc8edf6afe93901c (diff) |
Fix Freestyle not copying Cycles properties to stroke rendering scene.
Diffstat (limited to 'source/blender/freestyle/intern')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 79f17756ca6..d29e3c95e41 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -45,6 +45,7 @@ extern "C" { #include "BKE_collection.h" #include "BKE_customdata.h" +#include "BKE_idprop.h" #include "BKE_global.h" #include "BKE_library.h" /* free_libblock */ #include "BKE_material.h" @@ -120,6 +121,11 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str freestyle_scene->r.im_format.planes = R_IMF_PLANES_RGBA; freestyle_scene->r.im_format.imtype = R_IMF_IMTYPE_PNG; + // Copy ID properties, including Cycles render properties + if (old_scene->id.properties) { + freestyle_scene->id.properties = IDP_CopyProperty_ex(old_scene->id.properties, 0); + } + if (G.debug & G_DEBUG_FREESTYLE) { printf("%s: %d thread(s)\n", __func__, BKE_render_num_threads(&freestyle_scene->r)); } @@ -480,23 +486,10 @@ void BlenderStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const } if (STREQ(freestyle_scene->view_render.engine_id, RE_engine_id_CYCLES)) { - PointerRNA scene_ptr, freestyle_scene_ptr; - RNA_pointer_create(NULL, &RNA_Scene, old_scene, &scene_ptr); - RNA_pointer_create(NULL, &RNA_Scene, freestyle_scene, &freestyle_scene_ptr); - - PointerRNA cycles_ptr = RNA_pointer_get(&scene_ptr, "cycles"); + /* Render with transparent background. */ + PointerRNA freestyle_scene_ptr; + RNA_id_pointer_create(&freestyle_scene->id, &freestyle_scene_ptr); PointerRNA freestyle_cycles_ptr = RNA_pointer_get(&freestyle_scene_ptr, "cycles"); - - int flag; - RNA_STRUCT_BEGIN(&freestyle_cycles_ptr, prop) - { - flag = RNA_property_flag(prop); - if (flag & PROP_HIDDEN) - continue; - RNA_property_copy(&freestyle_cycles_ptr, &cycles_ptr, prop, -1); - } - RNA_STRUCT_END; - RNA_boolean_set(&freestyle_cycles_ptr, "film_transparent", 1); } |