I'm developing a program that outputs object files that can be imported into Blender. The output consists of a WaveFront object file (.obj) with a Material Library File (.mtl) that go side-by-side.
The importing works fine and the textures all show up correctly mapped, however I would like to apply a transformation to the textures so that the scale values don't need to be manually tweaked inside Blender after the import.
Following the specifications for the MTL format (http://paulbourke.net/dataformats/mtl/) the scaling would be transformed by using the -s argument, like below.
newmtl AM_BBAY_WINDOWS_PIRATE
illum 2
Kd 1.000000 1.000000 1.000000
Ka 0.250000 0.250000 0.250000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ns 0.000000
map_Kd -s 1.0 -1.0 1.0 AM_BBAY_WINDOWS_PIRATE.png
Expected behavior: Blender should use AM_BBAY_WINDOWS_PIRATE.png as the texture file and set the material size to 1.0, -1.0, 1.0.
Actual behavior: The size is kept as default and the file is set to -s 1.0 -1.0 1.0 AM_BBAY_WINDOWS_PIRATE.png which obviously is invalid and therefore does not work.
Why is Blender completely ignoring the arguments for texture maps in material libraries for imported objects? Is there another method/syntax for Blender that I've missed?
.objimporter is written Python, you could have a look at../scripts/addons/io_scene_obj/import_obj.py. If it's part of the spec, and your file is valid, perhaps a bug report is appropriate. – zeffii Oct 12 '15 at 07:11.mtlspec. Generally we close this kind of question because it is a bug report, and there is no obvious solution without modifying the importer code. Feel free to experiment with patching the importer, it's more likely to be fixed sooner by someone with a vested interest. – zeffii Oct 13 '15 at 07:46