diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-03 13:13:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-03 13:13:47 +0400 |
commit | 5eef9374362eb1089f08d4ab5f397843d2301d7a (patch) | |
tree | 5782d7cf8e1e55bedb783e6db09d88ed8f4ee907 /release/scripts/modules | |
parent | e2393d11090765caf987e5ef8e2e688d80c0e64d (diff) |
modify previous api feature to tag functions as permanent, use nicer decorator style, eg:
# --------
import bpy
from bpy.app.handlers import persistent
@persistent
def my_func(scene):
pass
bpy.app.handlers.frame_change_pre.append(my_func)
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy/__init__.py b/release/scripts/modules/bpy/__init__.py index 5fe5cfd7cf4..75572a6294e 100644 --- a/release/scripts/modules/bpy/__init__.py +++ b/release/scripts/modules/bpy/__init__.py @@ -54,6 +54,8 @@ def main(): # fake module to allow: # from bpy.types import Panel + sys.modules["bpy.app"] = app + sys.modules["bpy.app.handlers"] = app.handlers sys.modules["bpy.types"] = types #~ if "-d" in sys.argv: # Enable this to measure start up speed |