4
$\begingroup$

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?

Thanks.

$\endgroup$
  • 1
    $\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 '18 at 13:13
1
$\begingroup$

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

$\endgroup$
  • $\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$ – Shuangjun Liu Jan 11 '18 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.