I am trying to set up a sky in my script using
bpy.context.scene.world.use_sky_paper = True which results in the following error:
AttributeError: 'NoneType' object has no attribute 'use_sky_paper'
Why does bpy.context.scene.world return None? Is there some setup required for the world?
I encountered a similar problem, when trying to see which area is active via bpy.context.area.type where area is None.
Update: bpy.context.area is always None when running script headless.
context.area.typeis nevernone. Cycles or Internal? What blender version? Are you trying to execute that commands headless (without UI)? – brockmann Aug 29 '17 at 08:54blender --background --python <name_of_script>. Executingprint(bpy.context.area)printsNoneto the console. – McLawrence Aug 29 '17 at 09:05bpy.context.areareturns the active area of the UI, it's totally obvious why the property isnone. Also I have no problems printingWorld.use_sky_paperto the command line. Does this example helps? – brockmann Aug 29 '17 at 09:22bpy.ops.object.mode_set(mode='OBJECT')as suggested by the example. – McLawrence Aug 29 '17 at 10:10