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 \ } \