diff options
Diffstat (limited to 'source/blender/render/intern/source/bake_api.c')
-rw-r--r-- | source/blender/render/intern/source/bake_api.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/render/intern/source/bake_api.c b/source/blender/render/intern/source/bake_api.c index 73424a4e846..505af3c2fa8 100644 --- a/source/blender/render/intern/source/bake_api.c +++ b/source/blender/render/intern/source/bake_api.c @@ -684,6 +684,10 @@ void RE_bake_pixels_populate( int mat_nr = mp->mat_nr; int image_id = bake_images->lookup[mat_nr]; + if (image_id < 0) { + continue; + } + bd.bk_image = &bake_images->data[image_id]; bd.primitive_id = ++p_id; @@ -730,7 +734,7 @@ static void normal_uncompress(float out[3], const float in[3]) out[i] = 2.0f * in[i] - 1.0f; } -static void normal_compress(float out[3], const float in[3], const BakeNormalSwizzle normal_swizzle[3]) +static void normal_compress(float out[3], const float in[3], const eBakeNormalSwizzle normal_swizzle[3]) { const int swizzle_index[6] = { 0, /* R_BAKE_POSX */ @@ -773,7 +777,7 @@ static void normal_compress(float out[3], const float in[3], const BakeNormalSwi */ void RE_bake_normal_world_to_tangent( const BakePixel pixel_array[], const size_t num_pixels, const int depth, - float result[], Mesh *me, const BakeNormalSwizzle normal_swizzle[3], + float result[], Mesh *me, const eBakeNormalSwizzle normal_swizzle[3], float mat[4][4]) { size_t i; @@ -884,7 +888,7 @@ void RE_bake_normal_world_to_tangent( 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 BakeNormalSwizzle normal_swizzle[3]) + float result[], struct Object *ob, const eBakeNormalSwizzle normal_swizzle[3]) { size_t i; float iobmat[4][4]; @@ -912,7 +916,7 @@ void RE_bake_normal_world_to_object( void RE_bake_normal_world_to_world( const BakePixel pixel_array[], const size_t num_pixels, const int depth, - float result[], const BakeNormalSwizzle normal_swizzle[3]) + float result[], const eBakeNormalSwizzle normal_swizzle[3]) { size_t i; @@ -971,7 +975,7 @@ static bool bake_uv(const BakePixel pixel_array[], const size_t num_pixels, cons bool RE_bake_internal( Render *UNUSED(re), Object *UNUSED(object), const BakePixel pixel_array[], - const size_t num_pixels, const int depth, const ScenePassType pass_type, float result[]) + const size_t num_pixels, const int depth, const eScenePassType pass_type, float result[]) { switch (pass_type) { case SCE_PASS_UV: @@ -984,7 +988,7 @@ bool RE_bake_internal( return false; } -int RE_pass_depth(const ScenePassType pass_type) +int RE_pass_depth(const eScenePassType pass_type) { /* IMB_buffer_byte_from_float assumes 4 channels * making it work for now - XXX */ |