Commit: 507af0085519542647a1c605c0a1cf9940f70555
Author: Tamito Kajiyama
Date:   Thu Sep 11 13:41:14 2014 +0900
Branches: master
https://developer.blender.org/rB507af0085519542647a1c605c0a1cf9940f70555

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!

===================================================================

M       
source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
M       source/blender/makesrna/RNA_access.h

===================================================================

diff --git 
a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp 
b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
index 47b0c9b..456118d 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 8cbc198..f0582b3 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                                                        \
                }                                                               
      \

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to