Question

Set Names for OBJ textures

  • 22 March 2021
  • 3 replies
  • 17 views

Badge

Hello,

I'm creating a collection of building models from an ESRI file GDB feature class. I'm writing eachmultipatch to a Wavefront OBJ file. Any number of these OBJ files may be imported into a modeling program at the same time. I've had problems when different models refer to texture files that have the same name.

 

My workbench assigns a unique name to each OBJ file. I want each texture associated with a model to employ the unique obj name in the name of the texture image: eg: bosYU9732_[n].jpg

 

Currently, FME names each texture "noname[n].jpg where [n] is a small integer.

 

I found this thread from 2014 which seems to include tips for hacking the .mtl file. https://community.safe.com/s/question/0D54Q000080hE7FSAU/rename-material-and-texture-from-wavefront-obj-to-obj

 

Unfortunately many of the links are broken, and it is not clear whether any of the replies were useful to the original poster.

 

Has anyone got updated tips or an example for me?

 

Thank you!

 


3 replies

Userlevel 4
Badge +26

With some fme formats you can set the texture name by setting the appearance name. For others it doesn't work. ​I'm not sure if obj is one where it uses the appearance name.​

Badge

Hi Matt, Thanks for the reply.

My experiments indicate that changing the Appearance Names has no impact on the texture names in the output OBJ.

I am proceeding with a strategy of gathering the noname[n].jpg texture names from the .mtl file, replacing them with [model_id]_[n].jpg then to rename the texture files.

I'll also file a feature request because this seems like a lot of work to accomplish something that many people would want to do if it was a simple option on the obj writer.

If I come up with an improvement on the earlier post, I'll post more details here.

Thanks again.

Hi,

I'm one of those many who struggles with the same texture file naming issue. Doing batch processing, .obj's have each name of their own, but all textures and mtl's have non-unique names.

Reply