Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-10-18 13:35:29 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-10-18 13:35:29 +0400
commit61a330baca0ff9bb3cf477c04f539ef276a0356f (patch)
tree7c51dee268d1ac1d3dc9fb54371d3c0741316022 /source/blender/makesrna/intern
parent4b42c4bce41b139229c35781b6364cfb4125cba9 (diff)
Freestyle: Built-in SVG exporter.
Features: * Both still image and animation rendering, as well as polygon fills are supported. * The exporter creates a new SVG layer for every Freestyle line set. The different layers are correctly sorted. * SVG paths use data from line styles, so the base color of a line style becomes the color of paths, idem for dashes and stroke thickness. * Strokes can be split at invisible parts. This functionality is useful when exporting for instance dashed lines or line styles with a Blue Print shader * The exporter can be used not only in the Parameter Editor mode, but also from within style modules written for the Python Scripting mode. Acknowledgements: The author would like to thank Francesco Fantoni and Jarno Leppänen for their [[ https://github.com/hvfrancesco/freestylesvg | Freestyle SVG exporter ]]. Differential revision: https://developer.blender.org/D785 Author: flokkievids (Folkert de Vries) Reviewed by: kjym3 (Tamito Kajiyama)
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 70ce87ab68b..665779c03e9 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -4330,6 +4330,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
{R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes"},
{0, NULL, 0, NULL, NULL}
};
+
+ /* Freestyle SVG export */
+ static EnumPropertyItem freestyle_ui_svg_mode_items[] = {
+ {FREESTYLE_CONTROL_SVG_FRAME, "FRAME", 0, "Frame", "Write a single frame to the SVG file"},
+ {FREESTYLE_CONTROL_SVG_ANIMATION, "ANIMATION", 0, "Animation", "Write an animation to the SVG file"},
+ {0, NULL, 0, NULL, NULL}
+ };
/* Bake */
static EnumPropertyItem bake_mode_items[] = {
@@ -4860,6 +4867,35 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
"Note: affects indirectly rendered scenes)");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
+ prop = RNA_def_property(srna, "use_svg_export", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "svg_flag", FREESTYLE_SVG_EXPORT);
+ RNA_def_property_ui_text(prop, "SVG export",
+ "Export the freestyle view map to the given location");
+ RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
+
+ prop = RNA_def_property(srna, "svg_split_at_invisible", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "svg_flag", FREESTYLE_SVG_SPLIT_AT_INVISIBLE);
+ RNA_def_property_ui_text(prop, "Split at Invisible",
+ "Start a new SVG path when encountering an invisible stroke vertex");
+ RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
+
+ prop = RNA_def_property(srna, "svg_use_object_fill", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "svg_flag", FREESTYLE_SVG_OBJECT_FILL);
+ RNA_def_property_ui_text(prop, "Object Fill",
+ "Fill surface patches within contours (doesn't always work as expected)");
+ RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
+
+ prop = RNA_def_property(srna, "svg_path", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property_string_sdna(prop, NULL, "svg_path");
+ RNA_def_property_ui_text(prop, "SVG Output Path", "Path to store the svg ouput");
+ RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
+
+ prop = RNA_def_property(srna, "svg_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "svg_mode");
+ RNA_def_property_enum_items(prop, freestyle_ui_svg_mode_items);
+ RNA_def_property_ui_text(prop, "SVG Export Mode", "Select the SVG export mode");
+ RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_freestyle_update");
+
/* Bake */
prop = RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE);