Loader.readTextureNamesOBJ(String filename) plz?

Started by efaj, December 28, 2011, 12:57:28 PM

Previous topic - Next topic

efaj

Is it possible to get a function like Loader.readTextureNames3DS(String filename) -or at least for what I guess it does- but for OBJ files? I see the OBJ Loader already prints outs the names to the standard output, so I guess it's not that hard. -though maybe lengthy-

I'm writing a function to load an obj as I want simply and shortly, and with my naming rules to auto load the correct textures before the model.

AGP


EgonOlsen

Yes. That's the reason why i never did this...it's obvious. Just load the .mtl file, scan for lines starting with "map_Kd", collect the rest of the line in a set and you are done.

efaj

Quote from: EgonOlsen on December 28, 2011, 07:33:46 PM
Yes. That's the reason why i never did this...it's obvious. Just load the .mtl file, scan for lines starting with "map_Kd", collect the rest of the line in a set and you are done.
I know, but I was trying to avoid parsing it twice. But oh well, I haven't seen .mtl files to be large.