Blender Git Loki

Git Commits -> Revision 6f42eb2

Revision 6f42eb2 by Bastien Montagne (master)
September 27, 2018, 21:32 (GMT)
Python IO: Initial nodal shader support for import AND export.

That new bpy_extras' node_shader_utils module is remotely based on
existing addons' cycles_shader_compat module. It has some key
differences though:
- It is based on Principled shader, instead of the noodle combination
of half a dozen simpler shaders.
- It does not do any value conversion (like e.g. clamping, which was
only suited for FBX). Any conversion/adaptation is to be done
by each IO add-on.
- It extensively uses accessors to offer:
- Easy read/write of values, hiding all the hairy noodly nodes
(principled shader helps a lot here).
- lazy creation of most nodes on accessing (when generating a
material), which avoids getting unused nodes in final shader.
- We only use Principled BSDF so far though, which means some features
supported by previous system are not yet implemented in new one.

Note that, even though we support 'exporting' side of things, this will
only work for a very specific (and basic) kind of shader. This will have
to be clearly explained in end-user documentation.

Also, that code has had some basic testing, but most certainly needs a
lot more refinement.

As proof-of-concept, OBJ IO script will be updated to use that new
system after that commit.

Commit Details:

Full Hash: 6f42eb245b1572c76c8ade0b3fb89d51c796e97c
Parent Commit: 69c9266
Lines Changed: +590, -0

1 Added Path:

/release/scripts/modules/bpy_extras/node_shader_utils.py (+590, -0) (View)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021