that's different, its not an mtl problem on itself.
you expect now that the mtl color material is generated.
so far the parser does load and apply BitmapMaterials

It has been requested twice already, and will be supported.
but for now, you must apply a texture prior to export

you also can add a line in the mtl per material definitions

> newmtl blinn1SG
> illum 4
> Kd 1.00 1.00 1.00
> Ka 0.00 0.00 0.00
> Tf 1.00 1.00 1.00
> Ni 1.00
> Ks 0.50 0.50 0.50

map_Kd myFavouriteColor.jpg

note that obj format expect the mtl file to be next to the obj file
the parser uses then the obj adress to recompose the url of the resource

so if you pass for instance  "mydisc/awayproject/myModel.obj
if the mtl tag is exported
it will usually be declared as
mtllib myModel.mtl

the parser recomposes the url and it becomes "mydisc/awayproject/myModel.mtl"

the mtl is parsed and each time a map_Kd tag is found the same mechanism occurs 
again
and the material resource is then pushed to loading queue with the material id
for the mtl example above, it would then attemp to load 
"mydisc/awayproject/myFavouriteColor.jpg"

all mesh definitions found during parsing reffering to this material id 
"blinn1sg" would then receive this material.

Once we support the color definition, the system would simply push a 
colormaterial to the material list and apply when necessary.
again, for now, only maps are supported. The reason why this wasn't supported 
in previous versions is a legacy issue. in f9 or f10, running colormaterial was 
way slower than maps.
As this is not an issue any longer, we will gradually support more tags. this 
applies to other formats where color definitions are used as well.

Fabrice



On Apr 1, 2011, at 12:29 PM, Páll Zoltán wrote:

> Right, I've opened the OBJ and saw how it's linked to the MTL. The only 
> problem now that remains is the model from my colleague. In the OBJ there's 
> this line, referencing the material file:
> 
> mtllib test.mtl
> 
> later on, using a material defined in the MTL:
> 
> usemtl initialShadingGroup
> 
> MTL looks like this:
> 
> newmtl blinn1SG
> illum 4
> Kd 1.00 1.00 1.00
> Ka 0.00 0.00 0.00
> Tf 1.00 1.00 1.00
> Ni 1.00
> Ks 0.50 0.50 0.50
> newmtl initialShadingGroup
> illum 4
> Kd 1.00 0.05 0.00
> Ka 0.00 0.00 0.00
> Tf 1.00 1.00 1.00
> Ni 1.00
> newmtl lambert2SG
> illum 4
> Kd 0.89 0.89 0.89
> Ka 0.00 0.00 0.00
> Tf 1.00 1.00 1.00
> Ni 1.00
> 
> Unfortunately the loaded model is still textured with the checkerboard.
> 
> Z.
> 
> On Fri, Apr 1, 2011 at 12:20 PM, Fabrice3D <[email protected]> wrote:
> sure you can, its automatically handled by the objparser.
> even if you embed. But the reason some users want to get rid of the mtl is 
> because they want a single independant swf file
> embedding the obj when you have an mtl, still requires a load relative to swf 
> for external resources.
> this has nothing to do with the mtl mechanism on itself.
> In short they cry for awd2 :)
> 
> please take a look at examples files.
> The manager handles all automatically for any supported parser/fileformat
> so basically unless you specify the parser, the url is the only thing you 
> need to change for every format you want to load.
> therefor you can look at all examples regarding loading, they are all similar.
> 
> Fabrice
> 
> 
> On Apr 1, 2011, at 11:57 AM, Páll Zoltán 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