I ran into a fundamental problem in blender scripting. That is how to use the API document. When I ran into a function I don't know, basically, I will check the document to understand what that is. For example, some code employ

layers = tree.nodes.new('CompositorNodeRLayers')

Then what is that layer used for? Ok, let's check the API doc. However, it only gives what members are in that class but never introduces what this class is used for eventually or give any examples. https://docs.blender.org/api/blender_python_api_2_78_1/bpy.types.CompositorNodeRLayers.html

After reading this doc, I still have no idea what is that or how to use that. What is the input of that node and what will be the output?

So in such situation, what should we do? How to learn blender scripting by refering this API document?


  • 2
    $\begingroup$ IMO, you won't learn any language by reading the dictionary. Better to have a task in mind and work out how to code it, with guidance from the blender UI and the API. Look for context from the scripts where you have seen this one line of code "employed". $\endgroup$
    – batFINGER
    Jan 6, 2018 at 13:13

1 Answer 1


The API is for the programmatic options and things. What is happening in that line of code is a new node is being created of the type 'R_LAYERS' in the Compositor. In short, it just makes a Render Layers node. To know more about the node, you would need to look in the manual, not the API. Render Layers Node

  • $\begingroup$ I think you are right. Checking Blender manual first do help in scripting. They can help me to better understand those concepts used in blender instead of API docs. $\endgroup$ Jan 11, 2018 at 19:32
  • $\begingroup$ What helps for me: try to do your thing in Blender first, then see how you can reproduce that with Python. You can activate python tooltips to see how to convert each action into code. Go to Edit > Preferences > Interface > and check Python Tooltips. Then in Blender hover your cursor over an icon, and you will see the corresponding python code. $\endgroup$
    – Math_Max
    Aug 1, 2020 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .