[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19490] trunk/blender/release/scripts/ image_auto_layout.py: [#18479] 'Consolidate into one image' does not calculate/use 'pixel margin'

Campbell Barton ideasman42 at gmail.com
Wed Apr 1 09:13:56 CEST 2009


Revision: 19490
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19490
Author:   campbellbarton
Date:     2009-04-01 09:13:55 +0200 (Wed, 01 Apr 2009)

Log Message:
-----------
[#18479] 'Consolidate into one image' does not calculate/use 'pixel margin' 
Thanks to Dusan Stevanovic for pointing out the fix.

Also noticed alpha wasn't being rendered, enabled texface alpha.

Modified Paths:
--------------
    trunk/blender/release/scripts/image_auto_layout.py

Modified: trunk/blender/release/scripts/image_auto_layout.py
===================================================================
--- trunk/blender/release/scripts/image_auto_layout.py	2009-04-01 02:02:26 UTC (rev 19489)
+++ trunk/blender/release/scripts/image_auto_layout.py	2009-04-01 07:13:55 UTC (rev 19490)
@@ -9,7 +9,7 @@
 
 __author__ = "Campbell Barton"
 __url__ = ("blender", "blenderartists.org")
-__version__ = "1.1 2007/02/15"
+__version__ = "1.1a 2009/04/01"
 
 __bpydoc__ = """\
 This script makes a new image from the used areas of all the images mapped to the selected mesh objects.
@@ -273,9 +273,12 @@
 	
 	# New Mesh and Object
 	render_mat= B.Material.New()
-	render_mat.mode |= B.Material.Modes.SHADELESS
-	render_mat.mode |= B.Material.Modes.TEXFACE
-	render_mat.mode |= B.Material.Modes.ZTRANSP
+	render_mat.mode |= \
+			B.Material.Modes.SHADELESS | \
+			B.Material.Modes.TEXFACE | \
+			B.Material.Modes.TEXFACE_ALPHA | \
+			B.Material.Modes.ZTRANSP
+	
 	render_mat.setAlpha(0.0)
 		
 	render_me= B.Mesh.New()
@@ -420,7 +423,7 @@
 	
 	PREF_IMAGE_PATH= PREF_IMAGE_PATH.val
 	PREF_IMAGE_SIZE= PREF_IMAGE_SIZE.val
-	PREF_IMAGE_MARGIN= PREF_IMAGE_MARGIN.val
+	PREF_IMAGE_MARGIN= float(PREF_IMAGE_MARGIN.val) # important this is a float otherwise division wont work properly
 	PREF_KEEP_ASPECT= PREF_KEEP_ASPECT.val
 	PREF_ALL_SEL_OBS= PREF_ALL_SEL_OBS.val
 	





More information about the Bf-blender-cvs mailing list