forked from bartvdbraak/blender
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!
This commit is contained in:
parent
7aedfd654b
commit
507af00855
@ -31,6 +31,7 @@ extern "C" {
|
|||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "RNA_access.h"
|
#include "RNA_access.h"
|
||||||
|
#include "RNA_types.h"
|
||||||
|
|
||||||
#include "DNA_camera_types.h"
|
#include "DNA_camera_types.h"
|
||||||
#include "DNA_listBase.h"
|
#include "DNA_listBase.h"
|
||||||
@ -448,10 +449,24 @@ void BlenderStrokeRenderer::RenderStrokeRep(StrokeRep *iStrokeRep) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(freestyle_scene->r.engine, "CYCLES") == 0) {
|
if (strcmp(freestyle_scene->r.engine, "CYCLES") == 0) {
|
||||||
PointerRNA scene_ptr;
|
PointerRNA scene_ptr, freestyle_scene_ptr;
|
||||||
RNA_pointer_create(NULL, &RNA_Scene, freestyle_scene, &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");
|
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);
|
iStrokeRep->setMaterial(ma);
|
||||||
|
@ -1040,12 +1040,12 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name);
|
|||||||
CollectionPropertyIterator rna_macro_iter; \
|
CollectionPropertyIterator rna_macro_iter; \
|
||||||
for (RNA_property_collection_begin( \
|
for (RNA_property_collection_begin( \
|
||||||
sptr, \
|
sptr, \
|
||||||
RNA_struct_iterator_property(sptr->type), \
|
RNA_struct_iterator_property((sptr)->type), \
|
||||||
&rna_macro_iter); \
|
&rna_macro_iter); \
|
||||||
rna_macro_iter.valid; \
|
rna_macro_iter.valid; \
|
||||||
RNA_property_collection_next(&rna_macro_iter)) \
|
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 \
|
#define RNA_STRUCT_END \
|
||||||
} \
|
} \
|
||||||
|
Loading…
Reference in New Issue
Block a user