Transforming .mtl Material Definitions to jMonkey Material Definitions?

Hello,

is it possible to transform .mtl material defintions (created by Wavefront .obj exporter in Blender) to jMonkeyEngine material definitions? If so, how?

Thanks in advance.

Blender materials are not designed for real-time rendering. They don’t translate across to jme except for basic stuff like textures, uv mapping, etc.

MTL is not material definition from jME3’s point of view, its a material instance (e.g j3m file). You can load it directly via MTLLoader.load() and get a MaterialList.

MTLLoader needs an instance of AssetInfo to load something. How do I create one?

@myamo said: MTLLoader needs an instance of AssetInfo to load something. How do I create one?
Use the constructor.

I don’t know what the arguments mean. UrlAssetInfo takes an AssetKey and an URL for example. What are those?

Can I transform a .mtl into a .j3m per hand? Like turning this:

[java]newmtl Material.020
Ns 96.078431
Ka 0.000000 0.000000 0.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ni 1.000000
d 1.000000
illum 0
map_Kd dirt128.png[/java]

into a .j3m.

Maybe this helps?
http://hub.jmonkeyengine.org/javadoc/com/jme3/asset/AssetManager.html#locateAsset(com.jme3.asset.AssetKey)

Thanks, that worked.