From BlenderWiki
[edit] Render API Design — blender core
This is the section of the API which blender core uses to interface use renderers via the Render API.
[edit] Current Goals
This section explains the current goals of this API, and chiefly their limitations. Then I will provide the reasoning for limiting the goals as I have, and discuss the direction I hope this API will take.
First, here is the functionality.
- Get a blender menu string which includes plugin renderers.
- Create or Reuse a render context
- Render a render context
This is intended to be used only in the main render pipeline (the Render button, not preview renders), and only by plugin renderers. The render pipeline will detect the use of a plugin renderer, and use these functions instead of the old API equivalents.
Explanation
The old render module API for blender core is incompatible with external renderers: it has to be rewritten. This document will eventually become that rewrite. However, I've found that it is a bad idea to try to take on too big of a project at once. The addition of rewriting the blender core API and making the necessary changes to blender internal is too much. That is why I've limited the render API, for the time being, to this functionality:
- allow plugin exporters to interact with blender via the API
- create a fully functional renderer API
Only after this is in place will it be a sane decision to try to rewrite the blender core API. However, since this requires some of the blender core functionality in order to work, I've created this as a temporary, limited solution. I've tried to keep it especially limited so that anything that might need to be changed completely when this API is finished will be less difficult.
Future Direction
As I've said, the RE_ API needs to be rewritten. In my opinion almost the entire current API is really part of blender internal business. First of all, its use in blender internal needs to be examined. Why does blender core need access to blender internal's internal functionality? Some of it I know is simply misnaming.
Blender core needs to be able to tell the render module what scene to use, and to ask it to execute the render. It also needs to be able to assign callbacks for various things, such as drawing updates.
If the data needs to be specified on a more detailed level than 'scene,' or processing needs to be controlled at a more detailed level than 'create the render,' this access needs to be carefully considered. One of the parts that comes to mind is preview render optimization. These kinds of optimizations must be carefully considered.
[edit] Functions
char *RND_get_render_menu( int force_refresh ); RNDContext RND_context_create( const char name[], Scene *scene ); void RND_context_render( RNDContext context );







![[]](/skins/blender/open.png)
