[tubras] r1898 committed - irrB fog fix - Only use material fog property value if Blender's world...

0 views
Skip to first unread message

tub...@googlecode.com

unread,
Jan 5, 2012, 1:20:05 PM1/5/12
to tubras-s...@googlegroups.com
Revision: 1898
Author: pc0...@gmail.com
Date: Thu Jan 5 10:19:29 2012
Log: irrB fog fix - Only use material fog property value if Blender's
world mist
is enabled. If Blender's world mist is disabled, material fog is exported
as False.

http://code.google.com/p/tubras/source/detail?r=1898

Modified:
/trunk/tools/irrb/io_export_irrlicht.py

=======================================
--- /trunk/tools/irrb/io_export_irrlicht.py Wed Jan 4 16:11:58 2012
+++ /trunk/tools/irrb/io_export_irrlicht.py Thu Jan 5 10:19:29 2012
@@ -2228,6 +2228,7 @@
self.exporter = exporter
self.useVertexColor = True
self.vtCustom = None
+ self.globalFogEnabled = False

#
# Default attributes
@@ -2238,6 +2239,7 @@

if exporter.gContext.scene.world and \
exporter.gContext.scene.world.mist_settings.use_mist:
+ self.globalFogEnabled = True
self.attributes['FogEnable'] = True

self._updateFromBlenderMaterial(self.bmaterial)
@@ -2325,7 +2327,8 @@
self.attributes['ZWriteEnable'] = int(bmat.irrb_zwrite_enable)
self.attributes['BackfaceCulling'] = int(bmat.irrb_backcull)
self.attributes['FrontfaceCulling'] = int(bmat.irrb_frontcull)
- self.attributes['FogEnable'] = bmat.irrb_fog
+ if self.globalFogEnabled:
+ self.attributes['FogEnable'] = bmat.irrb_fog
self.attributes['NormalizeNormals'] =
int(bmat.irrb_normalize_normals)
self.attributes['UseMipMaps'] = int(bmat.irrb_use_mipmaps)
self.attributes['ZBuffer'] = E_COMPARISON_FUNC[bmat.irrb_zbuffer]

Reply all
Reply to author
Forward
0 new messages