150 switch (event->
type) {
188 const bool is_noncolor)
193 char *mask_buffer =
NULL;
194 const size_t num_pixels = (size_t)
width * (
size_t)
height;
202 if (margin > 0 || !is_clear) {
203 mask_buffer =
MEM_callocN(
sizeof(
char) * num_pixels,
"Bake Mask");
211 const char *from_colorspace;
212 const char *to_colorspace;
223 if (from_colorspace != to_colorspace) {
225 buffer, ibuf->
x, ibuf->
y, ibuf->
channels, from_colorspace, to_colorspace,
false);
312 for (
int i = 0; i < targets->
num_images; i++) {
334 const bool is_noncolor)
340 is_float = im_format->
depth > 8;
368 buffer, ibuf->
x, ibuf->
y, ibuf->
channels, from_colorspace, to_colorspace,
false);
386 char *mask_buffer =
NULL;
387 const size_t num_pixels = (size_t)
width * (
size_t)
height;
389 mask_buffer =
MEM_callocN(
sizeof(
char) * num_pixels,
"Bake Mask");
400 chmod(filepath, S_IRUSR | S_IWUSR);
413 return ELEM(pass_type,
455 const bool mcol_valid = (mcol !=
NULL &&
U.experimental.use_sculpt_vertex_colors);
457 if (mloopcol ==
NULL && !mcol_valid) {
460 "No vertex colors layer found in the object \"%s\"",
468 reports,
RPT_ERROR,
"No active UV layer found in the object \"%s\"", ob->
id.
name + 2);
472 for (
int i = 0; i < ob->
totcol; i++) {
475 const int mat_nr = i + 1;
489 "Circular dependency for image \"%s\" from object \"%s\"",
504 "Uninitialized image \"%s\" from object \"%s\"",
517 "No active image found in material \"%s\" (%d) for object \"%s\"",
525 "No active image found in material slot (%d) for object \"%s\"",
540 const int pass_filter,
562 "Combined bake pass Ambient Occlusion contribution requires an enabled light pass "
563 "(bake the Ambient Occlusion pass type instead)");
568 "Combined bake pass requires Emit, or a light pass with "
569 "Direct or Indirect contributions enabled");
576 "Combined bake pass requires Emit, or a light pass with "
577 "Direct or Indirect contributions enabled");
591 "Bake pass requires Direct, Indirect, or Color contributions to be enabled");
607 const bool is_selected_to_active,
615 if (is_selected_to_active) {
622 for (link = selected_objects->
first; link; link = link->
next) {
632 "Object \"%s\" is not a mesh or can't be converted to a mesh (Curve, Text, "
633 "Surface or Metaball)",
640 if (tot_objects == 0) {
651 for (link = selected_objects->
first; link; link = link->
next) {
674 const bool preserve_origindex)
692 int num_materials = ob->
totcol;
694 if (num_materials == 0) {
697 reports,
RPT_ERROR,
"No active image found, add a material or bake to an external file");
704 "No active image found, add a material or bake without the Split Materials option");
713 "BakeTargets.material_to_image");
718 for (
int i = 0; i < num_materials; i++) {
727 for (
int j = 0; j < i; j++) {
755 for (
int i = 0; i < targets->
num_images; i++) {
761 bk_image->
width = ibuf->
x;
765 targets->
num_pixels += (size_t)ibuf->
x * (
size_t)ibuf->
y;
786 for (
int i = 0; i < targets->
num_images; i++) {
789 pixel_array + bk_image->
offset,
804 "Problem saving the bake map internally for object \"%s\"",
810 reports,
RPT_INFO,
"Baking map saved to internal image, save it externally or pack it");
827 for (
int i = 0; i < targets->
num_images; i++) {
862 for (
int i = 0; i < targets->
num_images; i++) {
872 bake->im_format.imtype,
883 if (bk_image->
image) {
887 if (ob_eval->
mat[i]) {
890 else if (me->
mat[i]) {
896 sprintf(tmp,
"%d", i % 1000);
904 pixel_array + bk_image->
offset,
935 reports,
RPT_ERROR,
"Vertex color baking not support with object types other than mesh");
941 const bool mcol_valid = (mcol !=
NULL &&
U.experimental.use_sculpt_vertex_colors);
943 if (mloopcol ==
NULL && !mcol_valid) {
952 "BakeTargets.material_to_image");
967 const int *vert_origindex,
968 const int *poly_origindex,
974 const int vert_orig = vert_origindex[vert_eval];
975 const int poly_orig = poly_origindex[poly_eval];
982 MPoly *mpoly_orig = me_orig->
mpoly + poly_orig;
984 for (
int j = 0; j < mpoly_orig->
totloop; ++j, ++mloop_orig) {
985 if (mloop_orig->
v == vert_orig) {
1002 for (
int i = 0; i < num_pixels; i++) {
1008 pixel->
du_dx = 0.0f;
1009 pixel->
du_dy = 0.0f;
1010 pixel->
dv_dx = 0.0f;
1011 pixel->
dv_dy = 0.0f;
1012 pixel->
uv[0] = 0.0f;
1013 pixel->
uv[1] = 0.0f;
1027 for (
int i = 0; i < tottri; i++) {
1030 for (
int j = 0; j < 3; j++) {
1031 unsigned int l = lt->
tri[j];
1032 unsigned int v = me_eval->
mloop[
l].
v;
1035 if (vert_origindex !=
NULL && poly_origindex !=
NULL) {
1058 pixel->
uv[0] = 1.0f - FLT_EPSILON;
1059 pixel->
uv[1] = FLT_EPSILON / 2.0f;
1062 pixel->
uv[0] = FLT_EPSILON / 2.0f;
1063 pixel->
uv[1] = 1.0f - FLT_EPSILON;
1066 pixel->
uv[0] = FLT_EPSILON / 2.0f;
1067 pixel->
uv[1] = FLT_EPSILON / 2.0f;
1077 if (num_channels == 4) {
1080 else if (num_channels == 3) {
1096 const bool mcol_valid = (mcol !=
NULL &&
U.experimental.use_sculpt_vertex_colors);
1102 const int totvert = me->
totvert;
1103 const int totloop = me->
totloop;
1106 int *num_loops_for_vertex =
MEM_callocN(
sizeof(
int) * me->
totvert,
"num_loops_for_vertex");
1110 for (
int i = 0; i < totloop; i++, mloop++) {
1111 const int v = mloop->
v;
1113 num_loops_for_vertex[
v]++;
1117 for (
int i = 0; i < totvert; i++) {
1118 if (num_loops_for_vertex[i] > 0) {
1119 mul_v4_fl(mcol[i].color, 1.0f / num_loops_for_vertex[i]);
1128 const int totloop = me->
totloop;
1131 for (
int i = 0; i < totloop; i++, mloop++, mloopcol++) {
1183 "bake return pixels");
1216 bkr, targets, ob, ob_eval, me_eval, pixel_array, reports);
1258 int tot_highpoly = 0;
1264 int mmd_flags_low = 0;
1285 "No UV layer named \"%s\" found in the object \"%s\"",
1296 for (link = selected_objects->
first; link; link = link->
next) {
1299 if (ob_iter == ob_low) {
1326 mmd_flags_low = mmd_low->
flags;
1361 "Invalid cage object, the cage mesh must have the same number "
1362 "of faces as the active object");
1367 bool is_changed =
false;
1405 for (link = selected_objects->
first; link; link = link->
next) {
1408 if (ob_iter == ob_low) {
1413 highpoly[i].
ob = ob_iter;
1430 if (ob_cage !=
NULL) {
1439 "bake pixels high poly");
1451 (ob_cage ? ob_cage->
obmat : ob_low_eval->
obmat),
1458 for (i = 0; i < tot_highpoly; i++) {
1470 reports,
RPT_ERROR,
"Error baking from object \"%s\"", highpoly[i].ob->id.name + 2);
1530 ob_low_eval->
obmat);
1556 ob_low_eval->
obmat);
1577 bkr, &targets, ob_low, ob_low_eval, me_low_eval, pixel_array_low, reports)) {
1590 for (
int i = 0; i < tot_highpoly; i++) {
1591 if (highpoly[i].me !=
NULL) {
1599 mmd_low->
flags = mmd_flags_low;
1602 if (pixel_array_low) {
1606 if (pixel_array_high) {
1612 if (me_low_eval !=
NULL) {
1616 if (me_cage_eval !=
NULL) {
1695 G.is_rendering =
true;
1742 G.is_rendering =
false;
1805 G.is_rendering =
false;
1851 op->
ptr, prop, (
bake->cage_object) ?
bake->cage_object->id.name + 2 :
"");
1948 G.is_rendering =
true;
1967 ot->
description =
"Bake image textures of selected objects";
1982 "Type of pass to bake, some of them may not be supported by the current render engine");
1988 "Filter to combined, diffuse, glossy, transmission and subsurface passes");
1995 "Image filepath to use when saving externally");
2002 "Horizontal dimension of the baking map (external only)",
2011 "Vertical dimension of the baking map (external only)",
2020 "Extends the baked result as a post process filter",
2024 "use_selected_to_active",
2026 "Selected to Active",
2027 "Bake shading on the surface of selected objects to the active object");
2034 "The maximum ray distance for matching points between the active and selected "
2035 "objects. If zero, there is no limit",
2044 "Inflate the active object by the specified distance for baking. This helps "
2045 "matching to points nearer to the outside of the selected object meshes",
2053 "Object to use as cage, instead of calculating the cage from the active object "
2054 "with cage extrusion");
2060 "Choose normal space for baking");
2066 "Axis to bake in red channel");
2072 "Axis to bake in green channel");
2078 "Axis to bake in blue channel");
2084 "Where to output the baked map");
2090 "Where to save baked image textures");
2095 "Clear images before baking (only for internal saving)");
2099 "use_split_materials",
2102 "Split baked maps per material, using material name in output file (external only)");
2104 "use_automatic_name",
2107 "Automatically name the output file with the pass type");
2113 "UV layer to override active");
struct Scene * CTX_data_scene(const bContext *C)
int CTX_data_selected_objects(const bContext *C, ListBase *list)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct bScreen * CTX_wm_screen(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
int CustomData_get_active_layer_index(const struct CustomData *data, int type)
void * CustomData_get_layer(const struct CustomData *data, int type)
int CustomData_get_named_layer(const struct CustomData *data, int type, const char *name)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
int BKE_imbuf_write(struct ImBuf *ibuf, const char *name, const struct ImageFormatData *imf)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
void BKE_image_free_gputextures(struct Image *ima)
void BKE_image_path_from_imtype(char *string, const char *base, const char *relbase, int frame, const char imtype, const bool use_ext, const bool use_frames, const char *suffix)
void BKE_image_mark_dirty(struct Image *image, struct ImBuf *ibuf)
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
void BKE_id_free(struct Main *bmain, void *idv)
void BKE_main_id_tag_idcode(struct Main *mainvar, const short type, const int tag, const bool value)
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
void BKE_mesh_recalc_looptri(const struct MLoop *mloop, const struct MPoly *mpoly, const struct MVert *mvert, int totloop, int totpoly, struct MLoopTri *mlooptri)
struct Mesh * BKE_mesh_new_from_object(struct Depsgraph *depsgraph, struct Object *object, const bool preserve_all_data_layers, const bool preserve_origindex)
void BKE_mesh_split_faces(struct Mesh *mesh, bool free_loop_normals)
void BKE_modifier_free(struct ModifierData *md)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
bool BKE_node_is_connected_to_output(struct bNodeTree *ntree, struct bNode *node)
General operations, lookup, etc. for blender objects.
void BKE_object_handle_data_update(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
void BKE_object_eval_reset(struct Object *ob_eval)
void BKE_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_scene_graph_update_tagged(struct Depsgraph *depsgraph, struct Main *bmain)
struct ScrArea struct ScrArea * BKE_screen_find_big_area(struct bScreen *screen, const int spacetype, const short min)
File and directory operations.
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
void * BLI_findstring(const struct ListBase *listbase, const char *id, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE void linearrgb_to_srgb_uchar4(unsigned char srgb[4], const float linear[4])
MINLINE int poly_to_tri_count(const int poly_count, const int corner_count)
bool invert_m4_m4(float R[4][4], const float A[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
bool is_negative_m4(const float mat[4][4])
MINLINE void mul_v4_fl(float r[4], float f)
MINLINE void add_v4_v4(float r[4], const float a[4])
MINLINE void zero_v4(float r[4])
MINLINE void add_v3_v3(float r[3], const float a[3])
bool BLI_path_suffix(char *string, size_t maxlen, const char *suffix, const char *sep) ATTR_NONNULL()
Depsgraph * DEG_graph_new(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, eEvaluationMode mode)
struct Depsgraph Depsgraph
void DEG_graph_free(Depsgraph *graph)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_graph_build_from_view_layer(struct Depsgraph *graph)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
#define MAX_CUSTOMDATA_LAYER_NAME
@ eModifierType_EdgeSplit
Object is a sort of wrapper for general info.
#define R_BAKE_SPACE_OBJECT
#define R_BAKE_SPACE_WORLD
@ R_BAKE_TARGET_VERTEX_COLORS
@ R_BAKE_TARGET_IMAGE_TEXTURES
#define R_BAKE_SPACE_TANGENT
@ R_BAKE_PASS_FILTER_DIFFUSE
@ R_BAKE_PASS_FILTER_NONE
@ R_BAKE_PASS_FILTER_COLOR
@ R_BAKE_PASS_FILTER_SUBSURFACE
@ R_BAKE_PASS_FILTER_INDIRECT
@ R_BAKE_PASS_FILTER_DIRECT
@ R_BAKE_PASS_FILTER_GLOSSY
@ R_BAKE_PASS_FILTER_EMIT
@ R_BAKE_PASS_FILTER_TRANSM
@ SCE_PASS_SUBSURFACE_COLOR
bool ED_operator_object_active_editable_mesh(struct bContext *C)
bool ED_object_get_active_image(struct Object *ob, int mat_nr, struct Image **r_ima, struct ImageUser **r_iuser, struct bNode **r_node, struct bNodeTree **r_ntree)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
const char * IMB_colormanagement_get_rect_colorspace(struct ImBuf *ibuf)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
@ COLOR_ROLE_SCENE_LINEAR
void IMB_colormanagement_transform(float *buffer, int width, int height, int channels, const char *from_colorspace, const char *to_colorspace, bool predivide)
const char * IMB_colormanagement_get_float_colorspace(struct ImBuf *ibuf)
void IMB_buffer_float_from_float_mask(float *rect_to, const float *rect_from, int channels_from, int width, int height, int stride_to, int stride_from, char *mask)
struct ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
void IMB_freeImBuf(struct ImBuf *ibuf)
void IMB_buffer_float_from_float(float *rect_to, const float *rect_from, int channels_from, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
void imb_freemipmapImBuf(struct ImBuf *ibuf)
void IMB_buffer_byte_from_float_mask(unsigned char *rect_to, const float *rect_from, int channels_from, float dither, bool predivide, int width, int height, int stride_to, int stride_from, char *mask)
void IMB_buffer_byte_from_float(unsigned char *rect_to, const float *rect_from, int channels_from, float dither, int profile_to, int profile_from, bool predivide, int width, int height, int stride_to, int stride_from)
Contains defines and structs used throughout the imbuf module.
@ IB_DISPLAY_BUFFER_INVALID
#define IB_PROFILE_LINEAR_RGB
Read Guarded memory(de)allocation.
@ WM_JOB_TYPE_OBJECT_BAKE
bool RE_bake_pixels_populate_from_objects(struct Mesh *me_low, BakePixel pixel_array_from[], BakePixel pixel_array_to[], BakeHighPolyData highpoly[], const int tot_highpoly, const size_t num_pixels, const bool is_custom_cage, const float cage_extrusion, const float max_ray_distance, float mat_low[4][4], float mat_cage[4][4], struct Mesh *me_cage)
void RE_bake_normal_world_to_world(const BakePixel pixel_array[], const size_t num_pixels, const int depth, float result[], const eBakeNormalSwizzle normal_swizzle[3])
void RE_bake_normal_world_to_object(const BakePixel pixel_array[], const size_t num_pixels, const int depth, float result[], struct Object *ob, const eBakeNormalSwizzle normal_swizzle[3])
int RE_pass_depth(const eScenePassType pass_type)
void RE_bake_normal_world_to_tangent(const BakePixel pixel_array[], const size_t num_pixels, const int depth, float result[], Mesh *me, const eBakeNormalSwizzle normal_swizzle[3], float mat[4][4])
void RE_bake_mask_fill(const BakePixel pixel_array[], const size_t num_pixels, char *mask)
void RE_bake_ibuf_clear(Image *image, const bool is_tangent)
void RE_bake_margin(ImBuf *ibuf, char *mask, const int margin)
void RE_bake_pixels_populate(Mesh *me, BakePixel pixel_array[], const size_t num_pixels, const BakeTargets *targets, const char *uv_layer)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
const Depsgraph * depsgraph
bool RE_bake_engine(Render *re, Depsgraph *depsgraph, Object *object, const int object_id, const BakePixel pixel_array[], const BakeTargets *targets, const eScenePassType pass_type, const int pass_filter, float result[])
void RE_bake_engine_set_engine_parameters(Render *re, Main *bmain, Scene *scene)
bool RE_bake_has_engine(Render *re)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
#define unit_float_to_uchar_clamp_v4(v1, v2)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static int bake_exec(bContext *C, wmOperator *op)
static Mesh * bake_mesh_new_from_object(Depsgraph *depsgraph, Object *object, const bool preserve_origindex)
static bool bake_targets_init_vertex_colors(BakeTargets *targets, Object *ob, ReportList *reports)
static void bake_init_api_data(wmOperator *op, bContext *C, BakeAPIRender *bkr)
static bool bake_targets_output_vertex_colors(BakeTargets *targets, Object *ob)
void OBJECT_OT_bake(wmOperatorType *ot)
static bool bake_targets_output(const BakeAPIRender *bkr, BakeTargets *targets, Object *ob, Object *ob_eval, Mesh *me_eval, BakePixel *pixel_array, ReportList *reports)
struct BakeAPIRender BakeAPIRender
static int find_original_loop(const Mesh *me_orig, const int *vert_origindex, const int *poly_origindex, const int poly_eval, const int vert_eval)
static bool write_internal_bake_pixels(Image *image, BakePixel pixel_array[], float *buffer, const int width, const int height, const int margin, const bool is_clear, const bool is_noncolor)
static void bake_targets_populate_pixels(const BakeAPIRender *bkr, BakeTargets *targets, Object *ob, Mesh *me_eval, BakePixel *pixel_array)
static bool bake_object_check(ViewLayer *view_layer, Object *ob, const eBakeTarget target, ReportList *reports)
static bool bake_targets_init_image_textures(const BakeAPIRender *bkr, BakeTargets *targets, Object *ob, ReportList *reports)
static int bake(const BakeAPIRender *bkr, Object *ob_low, const ListBase *selected_objects, ReportList *reports)
static bool bake_targets_output_external(const BakeAPIRender *bkr, BakeTargets *targets, Object *ob, Object *ob_eval, Mesh *me, BakePixel *pixel_array, ReportList *reports)
static void bake_update_image(ScrArea *area, Image *image)
static bool bake_targets_init(const BakeAPIRender *bkr, BakeTargets *targets, Object *ob, Object *ob_eval, ReportList *reports)
static bool bake_targets_init_internal(const BakeAPIRender *bkr, BakeTargets *targets, Object *ob, ReportList *reports)
static bool bake_objects_check(Main *bmain, ViewLayer *view_layer, Object *ob, ListBase *selected_objects, ReportList *reports, const bool is_selected_to_active, const eBakeTarget target)
static void bake_progress_update(void *bjv, float progress)
static void bake_startjob(void *bkv, short *UNUSED(stop), short *do_update, float *progress)
static int bake_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
static bool write_external_bake_pixels(const char *filepath, BakePixel pixel_array[], float *buffer, const int width, const int height, const int margin, ImageFormatData *im_format, const bool is_noncolor)
static int bake_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int bake_break(void *UNUSED(rjv))
static bool bake_targets_output_internal(const BakeAPIRender *bkr, BakeTargets *targets, Object *ob, BakePixel *pixel_array, ReportList *reports)
static void bake_targets_refresh(BakeTargets *targets)
static void bake_targets_populate_pixels_vertex_colors(BakeTargets *targets, Object *ob, Mesh *me_eval, BakePixel *pixel_array)
static bool is_noncolor_pass(eScenePassType pass_type)
static void bake_result_add_to_rgba(float rgba[4], const float *result, const int num_channels)
static void bake_set_props(wmOperator *op, Scene *scene)
static bool bake_pass_filter_check(eScenePassType pass_type, const int pass_filter, ReportList *reports)
static void bake_freejob(void *bkv)
static void bake_targets_clear(Main *bmain, const bool is_tangent)
static void bake_targets_free(BakeTargets *targets)
static bool bake_targets_init_external(const BakeAPIRender *bkr, BakeTargets *targets, Object *ob, ReportList *reports)
void RE_progress_cb(Render *re, void *handle, void(*f)(void *handle, float))
Render * RE_NewSceneRender(const Scene *scene)
void RE_test_break_cb(Render *re, void *handle, int(*f)(void *handle))
void RE_SetReports(Render *re, ReportList *reports)
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_string_file_path(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_bake_pass_type_items[]
const EnumPropertyItem rna_enum_normal_swizzle_items[]
const EnumPropertyItem rna_enum_bake_pass_filter_type_items[]
const EnumPropertyItem rna_enum_bake_save_mode_items[]
const EnumPropertyItem rna_enum_bake_target_items[]
const EnumPropertyItem rna_enum_normal_space_items[]
eBakeNormalSwizzle normal_swizzle[3]
char uv_layer[MAX_CUSTOMDATA_LAYER_NAME]
char custom_cage[MAX_NAME]
ListBase selected_objects
bool is_selected_to_active
struct CollectionPointerLink * next
struct ImBuf * mipmap[IMB_MIPMAP_LEVELS]
struct CustomData pdata ldata
struct ModifierData * next
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_cursor_wait(bool val)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, void *owner, const char *name, int flag, int job_type)
bool WM_jobs_test(wmWindowManager *wm, void *owner, int job_type)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *))
void WM_jobs_timer(wmJob *wm_job, double timestep, unsigned int note, unsigned int endnote)