[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50575] trunk/blender/source/blender/ editors/space_image/image_edit.c: Fix #32547: unwrap on default cube got broken in recent commit.

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Sep 13 15:29:11 CEST 2012


Revision: 50575
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50575
Author:   blendix
Date:     2012-09-13 13:29:10 +0000 (Thu, 13 Sep 2012)
Log Message:
-----------
Fix #32547: unwrap on default cube got broken in recent commit.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_image/image_edit.c

Modified: trunk/blender/source/blender/editors/space_image/image_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_edit.c	2012-09-13 13:08:31 UTC (rev 50574)
+++ trunk/blender/source/blender/editors/space_image/image_edit.c	2012-09-13 13:29:10 UTC (rev 50575)
@@ -230,13 +230,19 @@
 
 void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *aspx, float *aspy)
 {
-	int w, h;
+	if (ima) {
+		int w, h;
 
-	BKE_image_get_aspect(ima, aspx, aspy);
-	BKE_image_get_size(ima, iuser, &w, &h);
+		BKE_image_get_aspect(ima, aspx, aspy);
+		BKE_image_get_size(ima, iuser, &w, &h);
 
-	*aspx *= (float)w;
-	*aspy *= (float)h;
+		*aspx *= (float)w;
+		*aspy *= (float)h;
+	}
+	else {
+		*aspx = 1.0f;
+		*aspy = 1.0f;
+	}
 }
 
 /* takes event->mval */




More information about the Bf-blender-cvs mailing list