Go to file
Dalai Felinto 97641a0ec9 Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.

The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.

The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit

Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake

bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.

Supported Features:
------------------
 * Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.

 * Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.

 * Cage Extrusion - distance to use for the inward ray cast when using selected to active

 * Custom Cage - object to use as cage (instead of the lowpoly object).

 * Normal swizzle - change the axis that gets mapped to RGB

 * Normal space - save as tangent or object normal spaces

Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"

Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)

* For a complete implementation example look at the Cycles Bake commit (next).

Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge

Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.

The entire commit history can be found on the branch: bake-cycles
2014-05-02 21:19:08 -03:00
build_files Install_deps.sh: do not use terminfo in our own llvm build. 2014-05-01 16:25:39 +02:00
doc Code cleanup: unused python vars & imports 2014-04-25 05:36:16 +10:00
extern Fix compilation on OSX after previous commit 2014-04-23 19:19:38 +06:00
intern Code cleanup: Add -Werror=float-conversion to Cycles 2014-05-03 07:31:46 +10:00
release Fix T39987: The new "redirect to bone constraints" button at the object constaints tab is wrong in bone edit mode 2014-05-01 21:24:30 +02:00
scons@2d6ebcb239 Basic support for UNC paths on Windows 2014-04-21 17:06:09 +02:00
source Bake API - bpy.ops.object.bake() 2014-05-02 21:19:08 -03:00
.arcconfig Use HTTPS protocol for arc 2013-12-24 22:57:27 +06:00
.gitignore .gitignore: Adding CMakeLists.txt.user for QtCreator users. 2014-01-26 17:52:14 -08:00
.gitmodules Initialize git submodules for addons, locales and scons 2013-11-15 12:19:08 +06:00
CMakeLists.txt Cycles CUDA: make CUDA toolkit 6.0 the official supported version. 2014-04-30 16:07:27 +02:00
COPYING == docs == 2010-10-13 14:44:22 +00:00
GNUmakefile Found another place where nproc can be used 2014-03-02 10:29:40 +01:00
SConstruct Scons/cycles: fix header distribution for geom 2014-04-04 13:07:32 +02:00