[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60945] branches/vgroup_modifiers/source/ blender: Fix a crash in tspace RNA func, when no UV name is given.

Bastien Montagne montagne29 at wanadoo.fr
Sat Oct 26 09:08:20 CEST 2013


Revision: 60945
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60945
Author:   mont29
Date:     2013-10-26 07:08:20 +0000 (Sat, 26 Oct 2013)
Log Message:
-----------
Fix a crash in tspace RNA func, when no UV name is given.

Modified Paths:
--------------
    branches/vgroup_modifiers/source/blender/blenkernel/intern/DerivedMesh.c
    branches/vgroup_modifiers/source/blender/makesrna/intern/rna_mesh_api.c

Modified: branches/vgroup_modifiers/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/vgroup_modifiers/source/blender/blenkernel/intern/DerivedMesh.c	2013-10-26 06:48:56 UTC (rev 60944)
+++ branches/vgroup_modifiers/source/blender/blenkernel/intern/DerivedMesh.c	2013-10-26 07:08:20 UTC (rev 60945)
@@ -2731,7 +2731,9 @@
 		return;
 
 	fnors = dm->getTessFaceDataArray(dm, CD_NORMAL);
-	/* Note, we assume we do have tessellated loop normals at this point, have to check this is valid... */
+	/* Note, we assume we do have tessellated loop normals at this point (in case it is object-enabled),
+	 * have to check this is valid...
+	 */
 	tlnors = dm->getTessFaceDataArray(dm, CD_TESSLOOPNORMAL);
 
 	/* check we have all the needed layers */

Modified: branches/vgroup_modifiers/source/blender/makesrna/intern/rna_mesh_api.c
===================================================================
--- branches/vgroup_modifiers/source/blender/makesrna/intern/rna_mesh_api.c	2013-10-26 06:48:56 UTC (rev 60944)
+++ branches/vgroup_modifiers/source/blender/makesrna/intern/rna_mesh_api.c	2013-10-26 07:08:20 UTC (rev 60945)
@@ -108,7 +108,12 @@
 	float (*loopuvcos)[2];
 
 	/* Check we have valid texture coordinates first! */
-	luvs = CustomData_get_layer_named(&mesh->ldata, CD_MLOOPUV, uvmap);
+	if (uvmap) {
+		luvs = CustomData_get_layer_named(&mesh->ldata, CD_MLOOPUV, uvmap);
+	}
+	else {
+		luvs = CustomData_get_layer(&mesh->ldata, CD_MLOOPUV);
+	}
 	if (luvs) {
 		float (*luvcos)[2];
 		int nloop;




More information about the Bf-blender-cvs mailing list