diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py index d3a90cb7acc..cabc741c701 100644 --- a/release/scripts/op/console_python.py +++ b/release/scripts/op/console_python.py @@ -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="") 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'}