diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-04-03 04:00:29 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-04-03 04:00:29 +0400 |
commit | 1e8d69ac7468670853a5714ebb2fc0d7c3cbf1be (patch) | |
tree | af5242223bfc453cbc3f46fef7caabe2695e3cab /source/blender/blenkernel/intern/freestyle.c | |
parent | 8709d4b624653ab404ef69162262f94ee8b3506e (diff) |
Use of text datablocks for storing Python style modules.
Suggested by Brecht Van Lommel and Campbell Barton through code review comments.
Previously style modules were external Python script files whose absolute paths
were kept in .blend files. Now style modules are stored in .blend files as text
datablocks.
Style modules are configured in three steps:
1. Open an external style module file (or create a new text datablock) in the
Text Editor in Blender.
2. Add a style module to the list of style modules (by pressing the "Add" button)
in the Render Layer properties window.
3. Click the name entry and select the style module from the drop-down menu.
Diffstat (limited to 'source/blender/blenkernel/intern/freestyle.c')
-rw-r--r-- | source/blender/blenkernel/intern/freestyle.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/freestyle.c b/source/blender/blenkernel/intern/freestyle.c index 56236e3effd..b514b004170 100644 --- a/source/blender/blenkernel/intern/freestyle.c +++ b/source/blender/blenkernel/intern/freestyle.c @@ -128,18 +128,14 @@ static FreestyleModuleConfig *alloc_module(void) void BKE_freestyle_module_add(FreestyleConfig *config) { FreestyleModuleConfig *module_conf = alloc_module(); - const size_t maxlen = sizeof(module_conf->module_path); BLI_addtail(&config->modules, (void *)module_conf); - - BLI_strncpy(module_conf->module_path, BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, "freestyle"), maxlen); - BLI_join_dirfile(module_conf->module_path, maxlen, module_conf->module_path, "style_modules"); - BLI_join_dirfile(module_conf->module_path, maxlen, module_conf->module_path, "contour.py"); + module_conf->script = NULL; module_conf->is_displayed = 1; } static void copy_module(FreestyleModuleConfig *new_module, FreestyleModuleConfig *module) { - strcpy(new_module->module_path, module->module_path); + new_module->script = module->script; new_module->is_displayed = module->is_displayed; } |