diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-09-11 08:41:14 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-09-11 08:41:14 +0400 |
commit | 507af0085519542647a1c605c0a1cf9940f70555 (patch) | |
tree | db65aee2626528ca29b75ed62201e49ef2453664 | |
parent | 7aedfd654bc1cba8b73be42a6938dc9857876069 (diff) |
Freestyle: Fix for missing quality control on line rendering in Cycles.
Freestyle was using the default Cycles rendering settings (e.g., the number
of samples) and users could not change them. Now all render parameters
(except for film_transparent) are inherited for Freestyle stroke rendering.
Problem report by Danny Grimm on Facebook, thanks!
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp | 21 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 4 |
2 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 47b0c9b1e48..456118d4d2f 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -31,6 +31,7 @@ extern "C" { #include "MEM_guardedalloc.h" #include "RNA_access.h" +#include "RNA_types.h" #include "DNA_camera_types.h" #include "DNA_listBase.h" @@ -448,10 +449,24 @@ void BlenderStrokeRenderer::RenderStrokeRep(StrokeRep *iStrokeRep) const } if (strcmp(freestyle_scene->r.engine, "CYCLES") == 0) { - PointerRNA scene_ptr; - RNA_pointer_create(NULL, &RNA_Scene, freestyle_scene, &scene_ptr); + 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"); - RNA_boolean_set(&cycles_ptr, "film_transparent", 1); + 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); } iStrokeRep->setMaterial(ma); diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 8cbc198837b..f0582b39819 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -1040,12 +1040,12 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name); CollectionPropertyIterator rna_macro_iter; \ for (RNA_property_collection_begin( \ sptr, \ - RNA_struct_iterator_property(sptr->type), \ + RNA_struct_iterator_property((sptr)->type), \ &rna_macro_iter); \ rna_macro_iter.valid; \ RNA_property_collection_next(&rna_macro_iter)) \ { \ - PropertyRNA *prop = rna_macro_iter.ptr.data; + PropertyRNA *prop = (PropertyRNA *)rna_macro_iter.ptr.data; #define RNA_STRUCT_END \ } \ |