diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-12-07 01:17:19 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-12-07 01:17:19 +0300 |
commit | 643b73e60ee51aa9f342f246c3e340eefe017516 (patch) | |
tree | b1a86b374e2977065a460ed3983843006dc4ff7e /source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp | |
parent | 8a2eb1f590c40cc9831d46d95434d9a63f31629b (diff) |
* Fix for a freeze issue in stroke rendering when using round/square caps.
The problem was caused by a stroke with only one vertex. Such a stroke was
generated when for some unknown reason a chained curve consisted of only
two vertices such that their 3D positions were exactly or almost the same.
* Fix for the Parameter Editor mode that failed when scene render layers
and/or linesets contain a single quote in their names.
Diffstat (limited to 'source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp index 5c6fc047572..2df05cd8970 100644 --- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp @@ -131,14 +131,31 @@ extern "C" { //print_m4("proj", freestyle_proj); } + static char *escape_quotes(char *name) + { + char *s= (char *)MEM_mallocN(strlen(name) * 2 + 1, "escape_quotes"); + char *p= s; + while (*name) { + if (*name == '\'') + *p++= '\\'; + *p++ = *name++; + } + *p = '\0'; + return s; + } + static Text *create_lineset_handler(char *layer_name, char *lineset_name) { - Text *text = add_empty_text(lineset_name); + char *s1= escape_quotes(layer_name); + char *s2= escape_quotes(lineset_name); + Text *text= add_empty_text(lineset_name); write_text(text, "import parameter_editor; parameter_editor.process('"); - write_text(text, layer_name); + write_text(text, s1); write_text(text, "', '"); - write_text(text, lineset_name); + write_text(text, s2); write_text(text, "')\n"); + MEM_freeN(s1); + MEM_freeN(s2); return text; } |