you might not have the latest obj, line 213 is now "}" Fabrice
On Apr 1, 2011, at 12:17 PM, Darcey Lloyd wrote: > That's the part I'm having trouble with... > > I've sussed out how to export the textures from blender now, this auto > updates the models reference to these images on export. However.... > > 1. The OBJ file contains code for a few references such as: > usemtl <id_of_texture_used_in_mtl_file> > > 2. This should then be looked up in the MTL file example: > newmtl <material_name_used_in_blender> > Ns <some numbers> > Ka <some numbers> > Kd <some numbers> > Ks <some numbers> > Ni <some numbers> > d <some numbers> > illum 2 > map_Kd <file name to texture.jpg> > > Thus linking the texture file to the MTL file and the MTL file is the lookup > for the OBJ file... > > For me at the moment, broomstick throws an error of: > ObjParser MTL LOAD ERROR: unable to load .mtl file > > TypeError: Error #1009: Cannot access a property or method of a null object > reference. > at away3d.loading.parsers::OBJParser/parseLine()[D:\wamp\www\Dev\Away3D > Broomstick\Away3D4_MeteorGame\src\away3d\loading\parsers\OBJParser.as:213] > at > away3d.loading.parsers::OBJParser/proceedParsing()[D:\wamp\www\Dev\Away3D > Broomstick\Away3D4_MeteorGame\src\away3d\loading\parsers\OBJParser.as:168] > at > away3d.loading.parsers::ParserBase/onInterval()[D:\wamp\www\Dev\Away3D > Broomstick\Away3D4_MeteorGame\src\away3d\loading\parsers\ParserBase.as:283] > at flash.utils::Timer/_timerDispatch() > at flash.utils::Timer/tick() > > > > I have both the OBJ, MTL and texture jpegs at the root with the swf, so not > sure why there is a problem with this. > > I have no examples to work from where an MTL file is used so am kind of > winging it at the moment. The EmbedParseDataTest with the examples of > broomstick when using the "assets/models/turtle.obj" which does have an MTL > file with it compiles as a blank. > > So at a guess, I think it's on a to do or is broken at the moment. > > D > > > On 1 April 2011 10:57, Páll Zoltán <[email protected]> wrote: > One more question: My colleague exported an OBJ from Maya, and it spit out an > MTL file too. That's the texture/material def, if I'm not mistaken. How do I > load that? Does the ResourceManager help with this? Or is it possible at all > to load MTL files? > > Z. > > > On Fri, Apr 1, 2011 at 11:16 AM, Páll Zoltán <[email protected]> wrote: > Will try that, thanks a lot :) > > Z. > > > On Fri, Apr 1, 2011 at 11:08 AM, Darcey Lloyd <[email protected]> wrote: > > I need to work out how to get blender to export the texture files, save & > create a uv from what is already in the files etc. I'm not sure who designed > the GUIs for Blender, Max or Maya but I think they just wanted to make them > as non user friendly as possible. > > > >
