<DIV>I picked up the fix and Exported to X3D from blender a 3D model of a pair of dice with multiple materials per object. You can see the X3D result as demo27 in this 3D gallery.</DIV>
<DIV> </DIV>
<DIV><A href="http://dl.dropbox.com/u/5095342/Xj3DApplet/rc1_pack200/3DGallery.html">http://dl.dropbox.com/u/5095342/Xj3DApplet/rc1_pack200/3DGallery.html</A></DIV>
<DIV> </DIV>
<DIV><BR><BR>----- Original Message -----<BR>From: Dave A <dave@realmofconcepts.com><BR>Date: Tuesday, January 4, 2011 9:24 pm<BR>Subject: Re: [X3D-Public] Multiple Materials for Geometry (IndexedFaceSet)<BR>To: JOHN COADY <johncoady@shaw.ca><BR>Cc: x3d-public@web3d.org<BR><BR>> As he said, and I said, yes, break the mesh up. One Appearance <BR>> per mesh <BR>> (IFS) is all you get. So break it up by material/texture (in <BR>> effect, <BR>> Appearance), and then Group the parts is your best bet. Doing <BR>> that <BR>> per-vertex color thing is more work than it's worth for blandly-<BR>> simple <BR>> objects.<BR>> And note that if there are light maps, bump maps, etc. <BR>> (MultiTexture) <BR>> you need to account for those as well. I would sort all polygons <BR>> sharing <BR>> the same Appearance into the SAME (sub)mesh, rather than <BR>> creating <BR>> separate polygons, where ever possible.<BR>> <BR>> Dave A.<BR>> <BR>> On 1/4/2011 6:04 PM, JOHN COADY wrote:<BR>> > Does anyone from the web3d community have any ideas on how <BR>> best to <BR>> > handle this issue when converting from blender to X3D. Blender <BR>> > supports multiple materials per object whereas X3D only <BR>> supports a <BR>> > single material per shape in an appearance node. For example, <BR>> in <BR>> > blender if you have a cube shaped object, you can assign a <BR>> different <BR>> > material to each of the 6 faces of the cube. When exporting <BR>> this <BR>> > object from blender into X3D the object is converted into a <BR>> shape with <BR>> > an IndexedFaceSet and an appearance node with a single <BR>> material. Only <BR>> > one of the 6 materials from the blender cube shaped object can <BR>> be <BR>> > assigned to the indexedFaceSet cubed shaped object in X3D. The <BR>> blender <BR>> > developer is suggesting to break up the cube shaped object <BR>> from <BR>> > blender and creating 6 separate IndexedFaceSet objects in X3D, <BR>> one for <BR>> > each face of the cube, so that he can assign a unique material <BR>> to each <BR>> > of the 6 faces. Is this a good idea? He wants to do the same <BR>> thing if <BR>> > there are multiple textures on the object in blender. The <BR>> other way to <BR>> > handle it is to use the color field of the indexed face set <BR>> and assign <BR>> > a color to each of the faces in X3D from the diffuse color of <BR>> the <BR>> > material in blender for that face.<BR>> ><BR>> > ----- Original Message -----<BR>> > From: Dave A <dave@realmofconcepts.com><BR>> > Date: Tuesday, January 4, 2011 5:28 pm<BR>> > Subject: Re: [X3D-Public] Multiple Materials for Geometry <BR>> (IndexedFaceSet)> To: Campbell Barton <ideasman42@gmail.com>, <BR>> X3D-Public@web3d.org<BR>> ><BR>> > > I think you need to break the mesh into pieces (then put <BR>> them in<BR>> > > a Group) because you can have only one Appearance per mesh.<BR>> > ><BR>> > > "Campbell Barton" <ideasman42@gmail.com> wrote:<BR>> > ><BR>> > > >Hi, I'm currently making some updates to blender 2.5'x X3D <BR>> exporter,> > >since we have a diligent user reporting all sorts <BR>> of bugs.<BR>> > > ><BR>> > > >One problem I've hit is that it seems there is no way to have<BR>> > > >different materials for one mesh.<BR>> > > ><BR>> > > >There are some ways that have been suggested but I find both<BR>> > > >unsatisfactory.<BR>> > > ><BR>> > > >1) Set colorPerVertex="false", then define color per face.<BR>> > > >This is no good because you may have different specular, diffuse<BR>> > > >values per material (not just color)<BR>> > > ><BR>> > > >2) Use MultiTexture?, This was suggested but from what I can<BR>> > > tell its<BR>> > > >only for layering textures, not applying different textures to<BR>> > > >different parts of the mesh.<BR>> > > ><BR>> > > >The things Id like to support are:<BR>> > > >- Different images on the same mesh.<BR>> > > >- Different material's on the same mesh.<BR>> > > ><BR>> > > >From what I can tell there is no way to do this so as a <BR>> last resort<BR>> > > >the exporter could split the object's materials into multiple<BR>> > > objects,>which is not ideal but I cant see an alternative.<BR>> > > ><BR>> > > >Am I missing something?.<BR>> > > ><BR>> > > >--<BR>> > > >- Campbell<BR>> > > ><BR>> > > >_______________________________________________<BR>> > > >X3D-Public mailing list<BR>> > > >X3D-Public@web3d.org<BR>> > > >http://web3d.org/mailman/listinfo/x3d-public_web3d.org<BR>> > ><BR>> > > --<BR>> > > Sent from my Android phone with K-9 Mail. Please excuse my <BR>> brevity.> ><BR>> > > _______________________________________________<BR>> > > X3D-Public mailing list<BR>> > > X3D-Public@web3d.org<BR>> > > http://web3d.org/mailman/listinfo/x3d-public_web3d.org<BR>> > ><BR>> </DIV>