Support for native render capabilities in custom render engines through Python API. (version 1)
AbandonedPublic

Authored by Alexander Romanov (a.romanov) on Mar 12 2015, 1:26 PM.

Details

Summary

This patch makes it possible to create custom render engines with native render capabilities (e.g. shader nodetree support).
Some refactoring and Python API expansions were made to enable BI and BGE capabilities accessible through Python.
Also it reduces the usage of conditional expressions with engine names (RE_engine_id_BLENDER_RENDER etc.) by using the bit flags instead, which makes the expressions more generic.

This feature is very important for Blend4Web custom render engine implementation (which needs Blender's shader node tree and other features). It also can be useful for other custom render engines.

There is more simple alternative for native nodetree only in D1188.

Alexander (Blend4Web Team)

Diff Detail

Repository
rB Blender
Branch
arcpatch-D1175
Evgeny Rodygin (Evgeny_Rodygin) retitled this revision from Native render features support for custom render engine. to Support for native render capabilities in custom render engines through Python API..Mar 13 2015, 12:50 PM
Evgeny Rodygin (Evgeny_Rodygin) updated this object.

A little curious what happens if you did something like:

bl_use_internal_engine = bl_use_game_engine = True

and hit the render button?

A little curious what happens if you did something like:

bl_use_internal_engine = bl_use_game_engine = True

and hit the render button?

If "render" method is defined in your Custom Render Engine it will be used. Otherwise, Blender Internal Render will be used.

  • Fixed resources free
  • refactoring + some fixes
Alexander Romanov (a.romanov) retitled this revision from Support for native render capabilities in custom render engines through Python API. to Support for native render capabilities in custom render engines through Python API. (version 1).Mar 17 2015, 1:19 PM
Alexander Romanov (a.romanov) updated this object.

I'm not entirely clear what you want to do here. How does external engine rendering interact with blender internal/game engine exactly? What kind of functionality of the internal pipeline are you trying to use? Is it possible even to feed external engine render data to the internal code? How?

I'm not entirely clear what you want to do here. How does external engine rendering interact with blender internal/game engine exactly?

It is not an interaction between BI/BGE and external render engine, but the possibility to use internal render engines' functionality.

What kind of functionality of the internal pipeline are you trying to use?

It is required to use native BI materials and their node tree in our case. It is also needed to build interface as in BI/BGE (for example, objects physics properties bar).

Is it possible even to feed external engine render data to the internal code? How?

No, we didn't suspect such possibilities.

If you use the internal pipeline why do you need an external engine? Or is it just to enhance parts of the internal render functionality by using an add-on? But from the way you describe it, it sounds like you have a render engine with its own render code? But it's a bit unclear to me why you would define a render engine to use another engine's node tree without the two interacting somehow.

You haven't really answered what you want to do, you just said that you need to use BI native materials. Apparently! But why? And how are the internal material data carried over to the external engine? Is it python? I'm just wondering if this is a hack to cover for something that should not really override the render engine to properly do.

If you use the internal pipeline why do you need an external engine? Or is it just to enhance parts of the internal render functionality by using an add-on? But from the way you describe it, it sounds like you have a render engine with its own render code? But it's a bit unclear to me why you would define a render engine to use another engine's node tree without the two interacting somehow.

You haven't really answered what you want to do, you just said that you need to use BI native materials. Apparently! But why? And how are the internal material data carried over to the external engine? Is it python? I'm just wondering if this is a hack to cover for something that should not really override the render engine to properly do.

As I said in D1188 Blend4Web uses the same nodes and tries to draw the material in browser similarly to the Viewport material. For now we attach properties to the standard Blender render profiles (render engine). This is not very useful because there are a lot of features that couldn't be implemented in WebGL at all (e.g rendering based on raycasting techniques). That's why we need our own render profile. This is not a full-scale engine but just a convenient way to configure scene for export to Blend4Web. The one feature is missing: it's not possible to use some BI/BGE features without switching engines, for example shader node editor is not accessible from the custom render. D1188 fixes this one, here you can see the more generic solution.

Hi Antony,

We are trying to make a Blend4Web-specific UI profile.
This profile should only display a limited set of settings both from the BI and BGE profiles.

Can we merge/close some of the patches, because it's confusing to have same functionality implemented in different ways in different patch reviews. Makes it difficult to keep track on stuff.