That's what I say, you do not have the latest!

it looks like this now
case "usemtl":
                                        if(_mtlLib){
                                                _materialIDs.push(trunk[1]);
                                                _activeMaterialID = trunk[1];
                                                _currentGroup.materialID= 
_activeMaterialID;
                                        }
                                        break;

go to this line and see for yourself
http://code.google.com/p/away3d/source/browse/trunk/broomstick/Away3D/src/away3d/loading/parsers/OBJParser.as

something's wrong with your svn client...

Fabrice

On Apr 1, 2011, at 12:46 PM, Darcey Lloyd wrote:

> I have trunk revision 3101 which should be latest, I just run svn update 
> again just encase.
> 
> As long as there is the possibility to preload OBJ, MTL and it's image assets 
> that is fine, or loading an SWF with a model embedded in it with it's 
> textures etc is also fine as long as we can preload and notify the user of 
> progress not a problem.
> 
> I have been referencing to the examples in the broomstick dir all the time, 
> the commented out example in EmbedParseDataTest.as for use with 
> "assets/models/head.ac" doesn't work for turtle.obj
> 
> Here is my code:
> 
> 
> modelContainer = ObjectContainer3D(ResourceManager.instance.parseData(new 
> model1Asset(), "Model1", false));
> 
> Results in error line 211 on OBJParser.as (ObjParser MTL LOAD ERROR: unable 
> to load .mtl file)
> 
>                               case "usemtl":
>                                       _materialIDs.push(trunk[1]);
>                                       _activeMaterialID = trunk[1];
>                                       _currentGroup.materialID= 
> _activeMaterialID;
>                                       break;
> 
> 
> The MTL, OBJ and texture jpegs are all in my root with the swf so no pathing 
> required.
> 
> Top of my OBJ file:
> 
> 
> # Blender3D v249 OBJ File: mkdcu-supermman.blend
> # www.blender3d.org
> mtllib superman.mtl
> v 0.088371 7.509277 0.234389
> v 0.131219 7.521957 0.229803
> v 0.082434 7.525477 0.260482
> 
> 
> My MTL File
> 
> # Blender3D MTL File: mkdcu-supermman.blend
> # Material Count: 14
> newmtl Accessory_MIC_super1.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super1.jpg
> 
> 
> newmtl material_25.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_33.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_26.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_21.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_20.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_29.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_27.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_28.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_23.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_9.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_24.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl material_22.001_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> newmtl Character_MIC_super2.jpg
> Ns 7.843137
> Ka 0.000000 0.000000 0.000000
> Kd 0.470400 0.470400 0.470400
> Ks 0.000000 0.000000 0.000000
> Ni 1.500000
> d 0.000000
> illum 2
> map_Kd super2.jpg
> 
> 
> 
> 
> D
> 
> 
> 
> 
> 
> On 1 April 2011 11:29, Fabrice3D <[email protected]> wrote:
> 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.
>> 
>> 
>> 
>> 
> 
> 

Reply via email to