diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-12-07 01:01:04 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2009-12-07 01:01:04 +0300 |
commit | 128f9730f2c63b85d397e9c09a612e806665c863 (patch) | |
tree | b730a76c5eeb8c06ec12a08b87f3b9facd098312 /source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp | |
parent | 092e708ee1ae5bf1dbf070144daf793540380d0e (diff) |
Added Freestyle.getCurrentScene() to give access to the current scene
from within style modules. Calling this function is only valid within
style modules. Calling it from the Python Interactive Console results
in an error as follows:
>>> import Freestyle
>>> Freestyle.getCurrentScene()
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: current scene not available
>>>
Diffstat (limited to 'source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp index 0f2160d7bf6..393cd1b2dd9 100644 --- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp @@ -39,6 +39,9 @@ extern "C" { float freestyle_proj[4][4]; int freestyle_viewport[4]; + // current scene + Scene *freestyle_scene; + string default_module_path; //======================================================= @@ -54,6 +57,7 @@ extern "C" { controller = new Controller(); view = new AppView; controller->setView(view); + freestyle_scene = NULL; default_module_path = pathconfig->getProjectDir() + Config::DIR_SEP + "style_modules" + Config::DIR_SEP + "contour.py"; @@ -203,6 +207,7 @@ extern "C" { init_view(re); init_camera(re); + freestyle_scene = re->scene; for(srl= (SceneRenderLayer *)re->scene->r.layers.first; srl; srl= srl->next) { if( !(srl->layflag & SCE_LAY_DISABLE) && @@ -238,6 +243,7 @@ extern "C" { } } + freestyle_scene = NULL; } //======================================================= |