[tubras] r1891 committed - irrb doc updates.

1 view
Skip to first unread message

tub...@googlecode.com

unread,
Dec 29, 2011, 7:53:14 AM12/29/11
to tubras-s...@googlegroups.com
Revision: 1891
Author: pc0der
Date: Thu Dec 29 04:52:01 2011
Log: irrb doc updates.

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

Modified:
/trunk/tools/irrb/doc/_static/img010.png
/trunk/tools/irrb/doc/irrbtheme/static/irrbdoc.css
/trunk/tools/irrb/doc/material_panel.rst
/trunk/tools/irrb/io_export_irrlicht.py

=======================================
--- /trunk/tools/irrb/doc/_static/img010.png Tue Feb 1 07:35:11 2011
+++ /trunk/tools/irrb/doc/_static/img010.png Thu Dec 29 04:52:01 2011
Binary file, no diff available.
=======================================
--- /trunk/tools/irrb/doc/irrbtheme/static/irrbdoc.css Sun Sep 25 05:10:35
2011
+++ /trunk/tools/irrb/doc/irrbtheme/static/irrbdoc.css Thu Dec 29 04:52:01
2011
@@ -362,3 +362,7 @@
-webkit-box-shadow: 5px 5px 10px #000000;
-moz-box-shadow: 5px 5px 10px #000000;
}
+
+div.irrb-padleft140 {
+ margin-left: 180px;
+ padding-left: 140px;}
=======================================
--- /trunk/tools/irrb/doc/material_panel.rst Mon Sep 26 10:03:18 2011
+++ /trunk/tools/irrb/doc/material_panel.rst Thu Dec 29 04:52:01 2011
@@ -5,25 +5,58 @@
.. toctree::
:maxdepth: 2

-The irrB material panel gives explicit control over every available
Irrlicht material
+The **irrB** material panel gives explicit control over every available
Irrlicht material
property. Mapping from a Blender material to an Irrlicht is difficult at
-best so irrB takes the approach of letting the user control the settings.
+best so **irrB** takes the approach of letting the user control the
settings.
In cases where there is a direct match between a Blender material property
-and an Irrlicht material property, irrB will use the Blender property and
-include an additional panel element in the irrB material panel.
+and an Irrlicht material property, **irrB** will use the Blender property
and
+include an additional panel element in the **irrB** material panel.

.. container:: irrb-left

.. image:: _static/img010.png

For example, Blender and Irrlicht both have a "Diffuse" material attribute.
-You can set the Diffuse color using Blender's GUI element, or in the irrB
+You can set the Diffuse color using Blender's GUI element, or in the
**irrB**
material panel.

-The irrB material panel contains a property that corresponds to
+The **irrB** material panel contains a property that corresponds to
every field that is available in Irrlicht's `SMaterial
<http://irrlicht.sourceforge.net/docu/classirr_1_1video_1_1_s_material.html>`_
and `SMaterialLayer
<http://irrlicht.sourceforge.net/docu/classirr_1_1video_1_1_s_material_layer.html>`_
data structures. These structures are used to programatically define
Irrlicht
Material settings.

-
+----
+
+Irrlicht Materials
+==================
+Currently, Irrlicht contains 24 pre-defined material "types". These
materials range
+from a simple "solid" material to a "transparent with parallax mapping"
material.
+
+In addition to the 24 pre-defined material types, Irrlicht also allows you
to create
+your own custom material type(s).
+
+Irrlicht supports multiple materials per mesh and **irrB** supports
exporting meshes
+with multiple materials as well.
+
+.. container:: irrb-padleft140
+
+ In Blender, you assign multiple materials to a mesh by:
+
+ 1. Selecting the mesh.
+
+ 2. Create a Material Slot and name the new material.
+
+ 3. Assign the newly created material to the appropriate faces in the
mesh.
+
+Each Blender Material that is created maintains its own set of related
Irrlicht (**irrB**)
+Material properties (type, diffuse, layers, etc.).
+
+----
+
+Irrlicht Material Texture Layers
+================================
+Irrlicht allows up to four texture layers (`SMaterialLayer
<http://irrlicht.sourceforge.net/docu/classirr_1_1video_1_1_s_material_layer.html>`_)
+to be defined per material.
+
+
=======================================
--- /trunk/tools/irrb/io_export_irrlicht.py Wed Dec 28 12:31:34 2011
+++ /trunk/tools/irrb/io_export_irrlicht.py Thu Dec 29 04:52:01 2011
@@ -2013,6 +2013,9 @@
step=3, precision=2,
options=emptySet)

+ bpy.types.Material.irrb_use_blender_textures = BoolProperty(name='Use
Blender Textures',
+ description='Use images from Blender texture layers',
default=False, options=emptySet)
+
wrap_options = (('ETC_REPEAT', 'Repeat', ''),
('ETC_CLAMP', 'Clamp', ''),
('ETC_CLAMP_TO_EDGE', 'Clamp To Edge', ''),
@@ -2445,6 +2448,30 @@

#=========================================================================
def setTextures(self, face):

+ bMaterial = self.bmaterial
+
+ if bMaterial and bMaterial.irrb_use_blender_textures:
+ tslots = [bMaterial.texture_slots[i] for i in
range(len(bMaterial.texture_slots)) \
+ if bMaterial.texture_slots[i]]
+
+ layerNumber = 1
+ for i in range(len(tslots)):
+ tslot = tslots[i]
+ tex = tslot.texture
+ if (tex.type == 'IMAGE') and (tslot.texture_coords
== 'UV') and \
+ (tslot.uv_layer != '') and (tex.image != None):
+ self.bimages.append(tex.image)
+ layerName = 'Layer{}'.format(layerNumber)
+ try:
+ texFile =
self.exporter.getImageFileName(tex.image, 0)
+ except:
+ texFile = '** error accessing {}
**'.format(tex.image.name)
+ self.attributes[layerName]['Texture'] = texFile
+ layerNumber += 1
+ if layerNumber >= 5:
+ break;
+ return
+
# count images assigned to uv layers
uvImageCount = 0
for layerNumber in range(len(self.bmesh.uv_textures)):
@@ -2467,32 +2494,6 @@
self.attributes[layerName]['Texture'] = texFile
return

- # no uv images so look for images in texture slots
- if self.bmaterial == None:
- return
-
- bMaterial = self.bmaterial
-
- tslots = [bMaterial.texture_slots[i] for i in
range(len(bMaterial.texture_slots)) \
- if bMaterial.texture_slots[i]]
-
- icount = 0
- for i in range(len(tslots)):
- tslot = tslots[i]
- tex = tslot.texture
- if (tex.type == 'IMAGE') and (tslot.texture_coords == 'UV')
and \
- (tslot.uv_layer != '') and (tex.image != None):
- self.bimages.append(tex.image)
- layerName = 'Layer{}'.format(layerNumber + 1)
- try:
- texFile = self.exporter.getImageFileName(tex.image, 0)
- except:
- texFile = '** error accessing {}
**'.format(tex.image.name)
- self.attributes[layerName]['Texture'] = texFile
- icount += 1
- if icount >= 5:
- break;
-

#=============================================================================
# i S c e n e

#=============================================================================
@@ -5791,6 +5792,7 @@

row = layout.row()
row.prop(mat, 'irrb_link_diffuse')
+ row.prop(mat, 'irrb_use_blender_textures')

row = layout.row()
row.label('ZBuffer')
@@ -5835,7 +5837,7 @@
row = layout.row()
row.prop(mat, 'irrb_shininess')
row.prop(mat, 'irrb_thickness')
-
+
def layoutLayer(layer):
layout.separator()
row = layout.row()

Reply all
Reply to author
Forward
0 new messages