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

This commit is contained in:
2010-07-27 00:38:00 +00:00
parent 432ec37965
commit dcb644af0d

View File

@@ -67,7 +67,7 @@ def get_console(console_id):
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 @@ def execute(context):
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 @@ def banner(context):
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'}