AttributeError: '_RestrictContext' object has no attribute 'scene'

Try to run Sunflow integration in Blender 2.5 BETA3/

Get the error

scene=bpy.context.scene

AttributeError: ‘_RestrictContext’ object has no attribute ‘scene’


    import bpy
import os
import platform
_SYS = platform.system()
scene=bpy.context.scene
ps = bpy.utils.script_paths()

How can I replace a string

scene=bpy.context.scene

you’ll have to rewrite the property handling:

http://wiki.blender.org/index.php/Extensions:2.6/Py/API_Changes#Restricted_Context