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.

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?


closed as off-topic by zeffii, Gwen, p2or, iKlsR Oct 13 '15 at 11:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ The .obj importer 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. $\endgroup$ – zeffii Oct 12 '15 at 7:11
  • $\begingroup$ @zeffii Looking through the file you pointed to, it doesn't seem the MTL importing has any support for texture map arguments at all. Where would one report this? $\endgroup$ – Kruithne Oct 12 '15 at 18:08
  • $\begingroup$ generally follow the advice on this question: blender.stackexchange.com/questions/1377/… $\endgroup$ – zeffii Oct 12 '15 at 18:20
  • 1
    $\begingroup$ @zeffii Thanks, made a bug report here: developer.blender.org/T46459 $\endgroup$ – Kruithne Oct 12 '15 at 21:06
  • 1
    $\begingroup$ @zeffii Talk about efficient, they patched it this morning. :) developer.blender.org/… $\endgroup$ – Kruithne Oct 13 '15 at 16:44

Browse other questions tagged or ask your own question.