Revision: 14288
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14288
Author:   blendix
Date:     2008-03-30 19:54:06 +0200 (Sun, 30 Mar 2008)

Log Message:
-----------

Fix for crash with UV unwrap without an image window open. It really
shouldn't be using the image window but for now this fixes the crash.

Modified Paths:
--------------
    trunk/blender/source/blender/src/editsima.c

Modified: trunk/blender/source/blender/src/editsima.c
===================================================================
--- trunk/blender/source/blender/src/editsima.c 2008-03-30 17:31:48 UTC (rev 
14287)
+++ trunk/blender/source/blender/src/editsima.c 2008-03-30 17:54:06 UTC (rev 
14288)
@@ -218,12 +218,18 @@
 {
        int w, h;
        float xuser_asp, yuser_asp;
-       
-       aspect_sima(G.sima, &xuser_asp, &yuser_asp);
-       
-       transform_width_height_tface_uv(&w, &h);
-       *aspx= (float)w/256.0f * xuser_asp;
-       *aspy= (float)h/256.0f * yuser_asp;
+
+       if(G.sima) {
+               aspect_sima(G.sima, &xuser_asp, &yuser_asp);
+               
+               transform_width_height_tface_uv(&w, &h);
+               *aspx= (float)w/256.0f * xuser_asp;
+               *aspy= (float)h/256.0f * yuser_asp;
+       }
+       else {
+               *aspx= 1.0f;
+               *aspy= 1.0f;
+       }
 }
 
 void transform_width_height_tface_uv(int *width, int *height)


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to