I am trying to enable backdrop in Blender using Python and using Blender's Python API (no GUI) but it seems that it is not as straight-forward as I thought. I know how to enable Use Nodes via bpy.context.scene.use_nodes = True and just need to enable backdrop. The most relevant Python documentation for backdrop Here is a bit unclear and I do not know exactly how I can enable backdropping through the NodeSpaceEditor class. Can someone explain how I can do that?
Update: it turns out that the Python documentation is useful when you are running Blender with the GUI. I need to enable backdrop when I am running Blender in the background.
The hard way is to compile Blender from scratch and enable backdropping by modifying the source code as explained here but this is too much of work. I hope there is a way to do it using Blender's Python API.
bpy.context.scene.use_nodes = Trueto use nodes and the next thing I need to do is to enable backdrop using one or more lines of Python code, which I don't know how to do as of now. – Amir Mar 14 '18 at 05:02context.space_data.use_backdrop = Trueas long as thecontext.area.type == 'NODE_EDITOR'otherwise loop screen areas and if node editor type usearea.spaces.active– batFINGER Mar 14 '18 at 10:55import bpyI do not have access tobpy.context.space_data.use_backdroporbpy.context.area.typebut I can setarea.typetoNODE_EDITORwhen I am using the Desktop version of Blender. Any ideas on how I can do it when using the Python module? Thank you – Amir Mar 14 '18 at 16:36