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
268 lines
12 KiB
C++
268 lines
12 KiB
C++
/*
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
* All rights reserved.
|
|
*
|
|
*
|
|
* Contributor(s): Blender Foundation
|
|
*
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
*/
|
|
|
|
/** \file blender/editors/object/object_intern.h
|
|
* \ingroup edobj
|
|
*/
|
|
|
|
#ifndef __OBJECT_INTERN_H__
|
|
#define __OBJECT_INTERN_H__
|
|
|
|
struct wmOperatorType;
|
|
struct KeyBlock;
|
|
struct Lattice;
|
|
struct Curve;
|
|
struct Object;
|
|
struct Mesh;
|
|
struct HookModifierData;
|
|
|
|
/* add hook menu */
|
|
enum eObject_Hook_Add_Mode {
|
|
OBJECT_ADDHOOK_NEWOB = 1,
|
|
OBJECT_ADDHOOK_SELOB,
|
|
OBJECT_ADDHOOK_SELOB_BONE
|
|
};
|
|
|
|
/* internal exports only */
|
|
|
|
/* object_transform.c */
|
|
void OBJECT_OT_location_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_rotation_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_scale_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_origin_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_visual_transform_apply(struct wmOperatorType *ot);
|
|
void OBJECT_OT_transform_apply(struct wmOperatorType *ot);
|
|
void OBJECT_OT_origin_set(struct wmOperatorType *ot);
|
|
|
|
/* object_relations.c */
|
|
void OBJECT_OT_parent_set(struct wmOperatorType *ot);
|
|
void OBJECT_OT_parent_no_inverse_set(struct wmOperatorType *ot);
|
|
void OBJECT_OT_parent_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_parent_set(struct wmOperatorType *ot);
|
|
void OBJECT_OT_track_set(struct wmOperatorType *ot);
|
|
void OBJECT_OT_track_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_slow_parent_set(struct wmOperatorType *ot);
|
|
void OBJECT_OT_slow_parent_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_make_local(struct wmOperatorType *ot);
|
|
void OBJECT_OT_make_single_user(struct wmOperatorType *ot);
|
|
void OBJECT_OT_make_links_scene(struct wmOperatorType *ot);
|
|
void OBJECT_OT_make_links_data(struct wmOperatorType *ot);
|
|
void OBJECT_OT_move_to_layer(struct wmOperatorType *ot);
|
|
void OBJECT_OT_drop_named_material(struct wmOperatorType *ot);
|
|
|
|
/* object_edit.c */
|
|
void OBJECT_OT_mode_set(struct wmOperatorType *ot);
|
|
void OBJECT_OT_editmode_toggle(struct wmOperatorType *ot);
|
|
void OBJECT_OT_posemode_toggle(struct wmOperatorType *ot);
|
|
void OBJECT_OT_hide_view_set(struct wmOperatorType *ot);
|
|
void OBJECT_OT_hide_view_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_hide_render_set(struct wmOperatorType *ot);
|
|
void OBJECT_OT_hide_render_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_proxy_make(struct wmOperatorType *ot);
|
|
void OBJECT_OT_shade_smooth(struct wmOperatorType *ot);
|
|
void OBJECT_OT_shade_flat(struct wmOperatorType *ot);
|
|
void OBJECT_OT_paths_calculate(struct wmOperatorType *ot);
|
|
void OBJECT_OT_paths_update(struct wmOperatorType *ot);
|
|
void OBJECT_OT_paths_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_forcefield_toggle(struct wmOperatorType *ot);
|
|
|
|
void OBJECT_OT_game_property_new(struct wmOperatorType *ot);
|
|
void OBJECT_OT_game_property_remove(struct wmOperatorType *ot);
|
|
void OBJECT_OT_game_property_copy(struct wmOperatorType *ot);
|
|
void OBJECT_OT_game_property_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_logic_bricks_copy(struct wmOperatorType *ot);
|
|
void OBJECT_OT_game_physics_copy(struct wmOperatorType *ot);
|
|
|
|
/* object_select.c */
|
|
void OBJECT_OT_select_all(struct wmOperatorType *ot);
|
|
void OBJECT_OT_select_random(struct wmOperatorType *ot);
|
|
void OBJECT_OT_select_by_type(struct wmOperatorType *ot);
|
|
void OBJECT_OT_select_by_layer(struct wmOperatorType *ot);
|
|
void OBJECT_OT_select_linked(struct wmOperatorType *ot);
|
|
void OBJECT_OT_select_grouped(struct wmOperatorType *ot);
|
|
void OBJECT_OT_select_mirror(struct wmOperatorType *ot);
|
|
void OBJECT_OT_select_same_group(struct wmOperatorType *ot);
|
|
|
|
/* object_add.c */
|
|
void OBJECT_OT_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_add_named(struct wmOperatorType *ot);
|
|
void OBJECT_OT_metaball_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_text_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_armature_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_empty_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_drop_named_image(struct wmOperatorType *ot);
|
|
void OBJECT_OT_lamp_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_effector_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_camera_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_speaker_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_group_instance_add(struct wmOperatorType *ot);
|
|
|
|
void OBJECT_OT_duplicates_make_real(struct wmOperatorType *ot);
|
|
void OBJECT_OT_duplicate(struct wmOperatorType *ot);
|
|
void OBJECT_OT_delete(struct wmOperatorType *ot);
|
|
void OBJECT_OT_join(struct wmOperatorType *ot);
|
|
void OBJECT_OT_join_shapes(struct wmOperatorType *ot);
|
|
void OBJECT_OT_convert(struct wmOperatorType *ot);
|
|
|
|
/* object_hook.c */
|
|
void OBJECT_OT_hook_add_selob(struct wmOperatorType *ot);
|
|
void OBJECT_OT_hook_add_newob(struct wmOperatorType *ot);
|
|
void OBJECT_OT_hook_remove(struct wmOperatorType *ot);
|
|
void OBJECT_OT_hook_select(struct wmOperatorType *ot);
|
|
void OBJECT_OT_hook_assign(struct wmOperatorType *ot);
|
|
void OBJECT_OT_hook_reset(struct wmOperatorType *ot);
|
|
void OBJECT_OT_hook_recenter(struct wmOperatorType *ot);
|
|
|
|
/* object_lattice.c */
|
|
void LATTICE_OT_select_all(struct wmOperatorType *ot);
|
|
void LATTICE_OT_select_more(struct wmOperatorType *ot);
|
|
void LATTICE_OT_select_less(struct wmOperatorType *ot);
|
|
void LATTICE_OT_select_ungrouped(struct wmOperatorType *ot);
|
|
void LATTICE_OT_select_random(struct wmOperatorType *ot);
|
|
void LATTICE_OT_select_mirror(struct wmOperatorType *ot);
|
|
void LATTICE_OT_make_regular(struct wmOperatorType *ot);
|
|
void LATTICE_OT_flip(struct wmOperatorType *ot);
|
|
|
|
/* object_group.c */
|
|
void GROUP_OT_create(struct wmOperatorType *ot);
|
|
void GROUP_OT_objects_remove_all(struct wmOperatorType *ot);
|
|
void GROUP_OT_objects_remove(struct wmOperatorType *ot);
|
|
void GROUP_OT_objects_add_active(struct wmOperatorType *ot);
|
|
void GROUP_OT_objects_remove_active(struct wmOperatorType *ot);
|
|
|
|
/* object_modifier.c */
|
|
void OBJECT_OT_modifier_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_modifier_remove(struct wmOperatorType *ot);
|
|
void OBJECT_OT_modifier_move_up(struct wmOperatorType *ot);
|
|
void OBJECT_OT_modifier_move_down(struct wmOperatorType *ot);
|
|
void OBJECT_OT_modifier_apply(struct wmOperatorType *ot);
|
|
void OBJECT_OT_modifier_convert(struct wmOperatorType *ot);
|
|
void OBJECT_OT_modifier_copy(struct wmOperatorType *ot);
|
|
void OBJECT_OT_multires_subdivide(struct wmOperatorType *ot);
|
|
void OBJECT_OT_multires_reshape(struct wmOperatorType *ot);
|
|
void OBJECT_OT_multires_higher_levels_delete(struct wmOperatorType *ot);
|
|
void OBJECT_OT_multires_base_apply(struct wmOperatorType *ot);
|
|
void OBJECT_OT_multires_external_save(struct wmOperatorType *ot);
|
|
void OBJECT_OT_multires_external_pack(struct wmOperatorType *ot);
|
|
void OBJECT_OT_meshdeform_bind(struct wmOperatorType *ot);
|
|
void OBJECT_OT_explode_refresh(struct wmOperatorType *ot);
|
|
void OBJECT_OT_ocean_bake(struct wmOperatorType *ot);
|
|
void OBJECT_OT_skin_root_mark(struct wmOperatorType *ot);
|
|
void OBJECT_OT_skin_loose_mark_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_skin_radii_equalize(struct wmOperatorType *ot);
|
|
void OBJECT_OT_skin_armature_create(struct wmOperatorType *ot);
|
|
void OBJECT_OT_laplaciandeform_bind(struct wmOperatorType *ot);
|
|
|
|
/* object_constraint.c */
|
|
void OBJECT_OT_constraint_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_constraint_add_with_targets(struct wmOperatorType *ot);
|
|
void POSE_OT_constraint_add(struct wmOperatorType *ot);
|
|
void POSE_OT_constraint_add_with_targets(struct wmOperatorType *ot);
|
|
|
|
void OBJECT_OT_constraints_copy(struct wmOperatorType *ot);
|
|
void POSE_OT_constraints_copy(struct wmOperatorType *ot);
|
|
|
|
void OBJECT_OT_constraints_clear(struct wmOperatorType *ot);
|
|
void POSE_OT_constraints_clear(struct wmOperatorType *ot);
|
|
|
|
void POSE_OT_ik_add(struct wmOperatorType *ot);
|
|
void POSE_OT_ik_clear(struct wmOperatorType *ot);
|
|
|
|
void CONSTRAINT_OT_delete(struct wmOperatorType *ot);
|
|
|
|
void CONSTRAINT_OT_move_up(struct wmOperatorType *ot);
|
|
void CONSTRAINT_OT_move_down(struct wmOperatorType *ot);
|
|
|
|
void CONSTRAINT_OT_stretchto_reset(struct wmOperatorType *ot);
|
|
void CONSTRAINT_OT_limitdistance_reset(struct wmOperatorType *ot);
|
|
void CONSTRAINT_OT_childof_set_inverse(struct wmOperatorType *ot);
|
|
void CONSTRAINT_OT_childof_clear_inverse(struct wmOperatorType *ot);
|
|
void CONSTRAINT_OT_objectsolver_set_inverse(struct wmOperatorType *ot);
|
|
void CONSTRAINT_OT_objectsolver_clear_inverse(struct wmOperatorType *ot);
|
|
void CONSTRAINT_OT_followpath_path_animate(struct wmOperatorType *ot);
|
|
|
|
/* object_vgroup.c */
|
|
void OBJECT_OT_vertex_group_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_remove(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_assign(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_assign_new(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_remove_from(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_select(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_deselect(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_copy_to_linked(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_transfer_weight(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_copy_to_selected(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_copy(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_normalize(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_normalize_all(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_levels(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_lock(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_fix(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_invert(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_blend(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_clean(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_quantize(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_limit_total(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_mirror(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_set_active(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_sort(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_group_move(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_weight_paste(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_weight_delete(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_weight_set_active(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_weight_normalize_active_vertex(struct wmOperatorType *ot);
|
|
void OBJECT_OT_vertex_weight_copy(struct wmOperatorType *ot);
|
|
|
|
/* object_warp.c */
|
|
void OBJECT_OT_vertex_warp(struct wmOperatorType *ot);
|
|
|
|
/* object_shapekey.c */
|
|
void OBJECT_OT_shape_key_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_shape_key_remove(struct wmOperatorType *ot);
|
|
void OBJECT_OT_shape_key_clear(struct wmOperatorType *ot);
|
|
void OBJECT_OT_shape_key_retime(struct wmOperatorType *ot);
|
|
void OBJECT_OT_shape_key_mirror(struct wmOperatorType *ot);
|
|
void OBJECT_OT_shape_key_move(struct wmOperatorType *ot);
|
|
|
|
/* object_group.c */
|
|
void OBJECT_OT_group_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_group_link(struct wmOperatorType *ot);
|
|
void OBJECT_OT_group_remove(struct wmOperatorType *ot);
|
|
|
|
/* object_bake.c */
|
|
void OBJECT_OT_bake_image(wmOperatorType *ot);
|
|
void OBJECT_OT_bake(wmOperatorType *ot);
|
|
|
|
/* object_lod.c */
|
|
void OBJECT_OT_lod_add(struct wmOperatorType *ot);
|
|
void OBJECT_OT_lod_remove(struct wmOperatorType *ot);
|
|
|
|
/* object_random.c */
|
|
void OBJECT_OT_vertex_random(struct wmOperatorType *ot);
|
|
|
|
#endif /* __OBJECT_INTERN_H__ */
|
|
|