From 1e8d69ac7468670853a5714ebb2fc0d7c3cbf1be Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Wed, 3 Apr 2013 00:00:29 +0000 Subject: 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. --- source/blender/blenkernel/intern/text.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/blender/blenkernel/intern/text.c') diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 29f16775598..4527d2a5056 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -519,6 +519,9 @@ void BKE_text_unlink(Main *bmain, Text *text) bNodeTree *ntree; bNode *node; Material *mat; + Scene *sce; + SceneRenderLayer *srl; + FreestyleModuleConfig *module; short update; for (ob = bmain->object.first; ob; ob = ob->id.next) { @@ -608,6 +611,16 @@ void BKE_text_unlink(Main *bmain, Text *text) } } + /* Freestyle */ + for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (srl = sce->r.layers.first; srl; srl = srl->next) { + for (module = srl->freestyleConfig.modules.first; module; module= module->next) { + if (module->script == text) + module->script = NULL; + } + } + } + text->id.us = 0; } -- cgit v1.2.3