[Bf-blender-cvs] [a8a5d68] master: Bake-API: throws error if there is no UV

Dalai Felinto noreply at git.blender.org
Thu May 22 20:05:13 CEST 2014


Commit: a8a5d68bb548dae30a1790169ba8d8a09fe811ea
Author: Dalai Felinto
Date:   Thu May 22 13:36:00 2014 -0300
https://developer.blender.org/rBa8a5d68bb548dae30a1790169ba8d8a09fe811ea

Bake-API: throws error if there is no UV

===================================================================

M	source/blender/editors/object/object_bake_api.c

===================================================================

diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 8a946e3..88e41ea 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,




More information about the Bf-blender-cvs mailing list