TG3 not using textures on OBJ import.

Started by PabloMack, April 07, 2014, 03:48:08 PM

Previous topic - Next topic

PabloMack

I know there are a lot of threads about this. I am importing an OBJ model in TG3 (using OBJ reader) and the textures are not showing when I go to render. Surfaces are are either all white or all black. There is indeed an mtl file and Lightwave is finding all of the textures through this file when I load the model into that application. It is an ASCII file and it seems to have all of the absolute paths to the textures.

jo

Hi,

Can you post the MTL file for us to look at?

Regards,

Jo

PabloMack

#2
Here is the latest one. I'm not getting any errors on the import like I was before I forgot to copy the mtl file into the same directory as the obj file. But the textures are still not there on the object.

PabloMack

#3
This is what I am seeing in the render (see pic #1 below). The roof and base come out black while the log "siding" comes out white. In the model, the roof is reddish-brown and base is a textured medium brown wood patternn while the siding is a light amber texture like pine coated with varnish (see pic #2 below).

[attach=1]

[attach=2]

jo

Hi,

The paths in the MTL file are not absolute paths, they're relative paths. I don't know enough about your drive setup to know whether these files should be found or not, or in fact whether TG would find files from paths like this (I will need to check next time I'm on Windows).

An absolute path would look like:

E:\Animation

whereas what you have is:

E:Animation

It should work if the paths in the MTL file were full absolute paths.

Regards,

Jo

PabloMack

#5
I looked at the paths and assumed that the '/' was implied. Besides, Windows uses the '\' instead of '/' so it stood to reason that the paths had to be edited by the application during loading anyway. Since Ligthtwave was finding the images okay, I assumed that it was the correct format. It may be the case that different vendors interpret "standards" different ways. And the current directory for E: may be initialized to something different in LW than in TG. This, I believe, is the directory that the object file is in.

I'll edit the mtl file and see if TG finds the images. But, keep in mind that TG is not reporting any erros when loading the file. This may be a bug. Perhaps it is generating errors but is not automatically bringing the error reporting panel up. I'll have to do some research on how to bring it up manually.

<<<<<<<<<<<<<<< LATER >>>>>>>>>>>>>>>>>

I edited the paths in the mtl file to be absolute according to UNIX rules (with slash leading the path as in "E:\path..."). The model is still not textured when rendering. Also, looking at the error panel using View/Errors and Warnings shows there to be no errors. If TG can't find the files then do you not think that it should report an error in the error panel?

jo

Hi,

I'll check out the path situation on Windows today. It may be a bug on our part, but it seems like it should work. I've never come across paths like that before myself. The paths in your file are ones which are relative to the current working directory of the specified drive (E). That makes them a little bit fragile because you don't always know what the current working directory might be. It could be that Lightwave sets the working directory which is why it works. I can only guess without knowing the layout of your filesystem though.

Windows can use "\" or "/" as a path separator.

If TG can't find the images it should be reporting it. You can check to see if it's loading the images using the Project Assets window. You can open this using the Show Project Assets item in the Project menu. There is documentation here:

http://www.planetside.co.uk/wiki/index.php?title=Project_Assets_Window

There are a couple of ways to open the Errors and Warnings window. You can click on the Errors and Warnings panel at the bottom right of the main window. It has the Error and Warning icons. You can tell if there are any errors or warnings because there will be the number of them next to the appropriate icon. You can also open the Errors and Warnings window from the View menu.

Regards,

Jo

PabloMack

#7
I looked in the assets panel and it is showing none of the textures that are part of the model. If I click on "Only show assets with problems" then the list goes empty. So TG is not loading them but it is not reporting the problem. Also, early on I forgot to copy the mtl file to the same directory where the obj is designated in the Obj reader node. It did report an error until I placed a copy of the file there. So that assures me that TG should be reading that file. Also, LW loads and displays the edited version of the mtl file correctly so I didn't do any damage when I edited it.

Now that I know that the mtl file is ASCII and, therefore editable, I'm next going to put one or more of the image files into the same directory with the obj. I'll then modify the mtl file so that it looks locally. That's the way I have done all of the plant models and it seems TG doesn't find the files unless I put them in the same directory. I have done this before for the cabin model but I didn't edit the paths in the mtl file. I'll let you know how things go. 

It seems that some 3D applications impose a file organization on you that aren't very efficient storage-wise. For example, if I want to use the LW rendering system called "ScreamerNet" then I have to replicate all of the assets into each project's file system. I guess, though, that this tends to buffer the projects against the possibility of one of the assets being modified for benefit of another project and thus "breaking" the project. Looks like if I ever want to use my render farm for LW renders, I'll have to organize my project files differently.

<<<<<<<<<< UPDATE >>>>>>>>>>

I changed all of the path names in the mtl file for one of the assets to look into the same directory were the obj is located. Actually, I had copied all of the images some time ago so they were already there. TG does not load or display the textures. Apparently, Lightwave assumes paths are all absolute regardless of whether there is a leading '/' or not in the path name. So I removed the path and only left the drive designator and the file name (in the form E:file.nam). Lightwave does not find them and complains of file not found. This tells me that Lightwave must be looking in the drive's root directory for them. I conclude that all path names in the mtl file are always interpreted as being absolute path names by LW.

Come to think of it, all of the models I have been using successfully are TGO's. I had stopped using OBJ's (and LWO's before that) because I could never get the textures to show. I would convert my OBJ's to TGO's if I had a way to do it. Using the method Dune pointed out in another thread won't do. The textures are already gone by the time I get the model into TG. It seems that the method of right-clicking on the node and saving an obj doesn't produce an mtl file either. I tried it and there is no matching mtl file. It seems that I have no way to create my own textured models that are usable by TG at this point in time.

jo

Hi,

Something isn't right. This stuff does work. I frequently use OBJ models. I think the best solution here is that you package up the model with all it's files and send it to me so I can check it out. I should be able to figure out what's happening and help you avoid these problems in the future. My email address is:

jomeder@planetside.co.uk

You can send me a zip file directly if it's not more than 10 MB, otherwise a link to download it would be great.

Regards,

Jo

mash

Sorry to stick my nose in but I'm an old light wave user.
Check that your obj has a UV map. Also that all polygons have are assigned to a UV map.
There was an old bug in the Lightwave OBJ exporter where if a single Polygon was not assigned a UV map it would delete the UV map.

Kadri

As Mash said there was a bug in the OBJ exporter.Not sure in which version.
Because of this i did not bother to export from Lightwave OBJ files.
Instead i open the LWO files directly in Poseray and export from there my OBJ files.
Since Poseray is very TG friendly this would be my way anyway.

PabloMack

#11
Quote from: mash on April 09, 2014, 09:38:45 PMCheck that your obj has a UV map. Also that all polygons have are assigned to a UV map. There was an old bug in the Lightwave OBJ exporter where if a single Polygon was not assigned a UV map it would delete the UV map.

That may be the problem. I am using planar texturing, not UV mapping. I prefer planar mapping in this case because it automatically repeats seamless patterns along the plane and it is far less work to texture flat surfaces than to use UV mapping. If TG does not support planar mapping then it probably explains the problem. But the mtl file that I posted should indicate the mapping method I used but it may be encoded as a number in one of the entries. I've done UV mapping before so I will give it a try.

<<<<<<<<<< UPDATE >>>>>>>>>>

I had trouble openning this file in my newest version of Lightwave because Windows would not let me associate the file type with the executable. It would run the old version instead and claim I had no license. So I uninstalled two older versions of Lightwave (never had this trouble before) and now Windows won't let me associate the obj file type with anything but Modo. So the only way I can open it with Lightwave is to drop the obj's icon onto a short cut pointing to Lightwave.

I can finally open obj's with Lightwave and I see that the textures are now UV mapped. So it must be the obj format that doesn't support planar mapping and so the Lightwave export is what created the UV map. So next, to address the issue that mash brings up, if I reload the obj model with Lightwave I see that the UV maps were not deleted because all polygons are assigned and everything looks as it should in Lightwave. But the issue still remains that TG doesn't load the textures and doesn't report that there is a problem.

There has to be a difference in the way LW and TG interpret the same obj file. But TG doesn't report a problem so there is at least one bug in TG.

jaf

Nearly every thread of this type seems to get a Poseray mention, so here goes.....
A nice feature with Poseray is you can correct your model's normals on the Groups tab.  On the Materials tab, you can check each part to see if it's getting the correct material assigned.  You may get a warning at the bottom of the window stating "x warnings -> Material (roofSurface......".  If that happens, you can go to the  "Tools" submenu under the Materials tab and select "Find all missing maps".  Then you can set up the search paths and click 'Search".  If you set up your search paths correctly, it should find all the maps and give you zero warnings.

One other thing.  When you export your Poseray processed object, there's an option to "Include the file paths to the image maps" or what I generally use "Copy all maps to the same directory"
(04Dec20) Ryzen 1800x, 970 EVO 1TB M.2 SSD, Corsair Vengeance 64GB DDR4 3200 Mem,  EVGA GeForce GTX 1080 Ti FTW3 Graphics 457.51 (04Dec20), Win 10 Pro x64, Terragen Pro 4.5.43 Frontier, BenchMark 0:10:02

PabloMack

Quote from: jaf on April 10, 2014, 01:00:47 PMA nice feature with Poseray is...

I can't believe the problem I just had. I went to download PoseRay and it said my browser is out of date. I updated all of my software about six months ago. I understand that IE6 is probably too old but 9? I'm updating windows now...

mash

If you have Modo try to apply a UV map there and then export it as a .OBJ or maybe try an FBX file.
I thinks Modo's OBJ exporter may be a bit more up to date than the Lightwave one.