Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2014-05-22 20:36:00 +0400
committerDalai Felinto <dfelinto@gmail.com>2014-05-22 22:05:01 +0400
commita8a5d68bb548dae30a1790169ba8d8a09fe811ea (patch)
tree1114e3ee9f95d6230e4d9ab0e54f776be4e328af
parent12e47d053646d0314d822a96c6d29cbefaf2a277 (diff)
Bake-API: throws error if there is no UV
-rw-r--r--source/blender/editors/object/object_bake_api.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 8a946e32a0f..88e41ead329 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -436,6 +436,12 @@ static int bake(
is_tangent = pass_type == SCE_PASS_NORMAL && normal_space == R_BAKE_SPACE_TANGENT;
tot_materials = ob_low->totcol;
+ /* ensure active uv */
+ if (CustomData_get_active_layer(&((Mesh *)ob_low->data)->pdata, CD_MTEXPOLY) == -1) {
+ BKE_report(reports, RPT_ERROR, "No active UV layer found in the active object");
+ goto cleanup;
+ }
+
if (tot_materials == 0) {
if (is_save_internal) {
BKE_report(reports, RPT_ERROR,