[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30786] trunk/blender/release/scripts/op/ console_python.py: bugfix [#22605] Context auto-compleate fails first time

Campbell Barton ideasman42 at gmail.com
Tue Jul 27 02:38:00 CEST 2010


Revision: 30786
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30786
Author:   campbellbarton
Date:     2010-07-27 02:38:00 +0200 (Tue, 27 Jul 2010)

Log Message:
-----------
bugfix [#22605] Context auto-compleate fails first time

Modified Paths:
--------------
    trunk/blender/release/scripts/op/console_python.py

Modified: trunk/blender/release/scripts/op/console_python.py
===================================================================
--- trunk/blender/release/scripts/op/console_python.py	2010-07-27 00:09:25 UTC (rev 30785)
+++ trunk/blender/release/scripts/op/console_python.py	2010-07-27 00:38:00 UTC (rev 30786)
@@ -67,7 +67,7 @@
         stdout = io.StringIO()
         stderr = io.StringIO()
     else:
-        namespace = {'__builtins__': __builtins__, 'bpy': bpy}
+        namespace = {"__builtins__": __builtins__, "bpy": bpy, "C": bpy.context}
         console = InteractiveConsole(locals=namespace, filename="<blender_console>")
 
         import io
@@ -97,10 +97,6 @@
 
     console, stdout, stderr = get_console(hash(context.region))
 
-    # Hack, useful but must add some other way to access
-    #if "C" not in console.locals:
-    console.locals["C"] = context
-
     # redirect output
     sys.stdout = stdout
     sys.stderr = stderr
@@ -243,10 +239,6 @@
     add_scrollback("", 'OUTPUT')
     sc.prompt = PROMPT
 
-    # Add context into the namespace for quick access
-    console = get_console(hash(context.region))[0]
-    console.locals["C"] = bpy.context
-
     return {'FINISHED'}
 
 





More information about the Bf-blender-cvs mailing list