TG3 not using textures on OBJ import.

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

Previous topic - Next topic

Oshyan

Unfortunately OBJ is not a very precise "standard", so these kinds of problems do sometimes occur. But as Jo noted, many of us do use OBJs all the time and don't run into these issues. If I'm understanding correctly, these objects are things *you* created in Lightwave, so it sounds more like a difference between LW's OBJ export and TG's OBJ import, their respective handling of the OBJ format. I do think sending an example non-working object to Jo is probably best, but if you just want to fix the problem ASAP, I have to echo the suggestion to try Poseray (which it seems you're now doing). It's very possible it will just take care of whatever issues are causing this.

- Oshyan

PabloMack

After studying it a while I think I am closer to understand what is going on. This is very interesting. If I load my original LWO file and export it to OBJ then load it into Modo, the textures display correctly. If I then export it from Modo into yet another OBJ then load it into either Modo or LW then the model still displays correctly in both applications. This tells me that neither the LW or Modo exporters or importers are broken. Everything works until you try to load it into TG. That's where it breaks.

There is something about the obj file that TG doesn't like. I suspected it was an innovative technique that both Modo and Lightwave use but I tested it and it must be something else. But I will put the discussion in any way for any one who is interested.

Now here is the theory I had: According to my understanding, UV maps spread a mesh across the image and specify what part of that image is projected onto each polygon. Most likely in its original definition, polygons must be smaller than the image so that the UV coordinates assigned to each vertex must fall onto the image somewhere. But this technique is limited and incapable of applying an image that is smaller than one of the polygons. Someone (whether it was one of the Modo, LW or other 3D SW development teams) figured out how to apply the same small image repeatedly across a very large polygon. The way this is done is by placing the UV coordinates far outside the limits of the image itself. For example, say a UV square is four times the size of the image you are using. This means that the image is repeated across the polygon to fill the whole thing four times. This is an ingenious method to get UV mapping to efficiently use a smaller image to fill a large area. I suspect that some companies do not honor this innovative extension to the UV mapping method. When the image and UV map are loaded it sees that UV coordinates lie outside the image and interpret it as a violation. I hypothesized that TG does this and just tosses it out. But I edited the UV map in Modo so that all UV coordinates fall inside the image. After saving it and reloading with both Modo and LW the texture is applied correctly. When I load the model into TG the texture was gone and the image was not in among the assets.

So, in conclusion, there is something about the OBJ file (other than UV coordinates outside the image) that TG doesn't like. I guess my next course of action is to either download PoseRay and see what it can do or face the arduous process of creating UV maps in Modo from scratch. Planar mapping of seamless patterns is so much easier than creating UV maps. I guess in this case I can join Badger and cry about having to use them.

jo

Hi,

I sent you an email a bit earlier today. The file you sent me loads fine on Windows and the Mac. I was wondering if it also works for you if load the same thing you sent me.

Regards,

Jo

TheBadger

QuoteI guess in this case I can join Badger and cry about having to use them

Yes, feel your hatred grow. Let it make you stronger. Join us! Be one of us!  :P
It has been eaten.

PabloMack

Quote from: Oshyan on April 11, 2014, 12:21:14 AM
Unfortunately OBJ is not a very precise "standard", so these kinds of problems do sometimes occur. But as Jo noted, many of us do use OBJs all the time and don't run into these issues. If I'm understanding correctly, these objects are things *you* created in Lightwave, so it sounds more like a difference between LW's OBJ export and TG's OBJ import, their respective handling of the OBJ format. I do think sending an example non-working object to Jo is probably best, but if you just want to fix the problem ASAP, I have to echo the suggestion to try Poseray (which it seems you're now doing). It's very possible it will just take care of whatever issues are causing this.

You are correct. In light of the fact that Modo was developed by some of Lightwave's original developers, it stands to reason that they carried over the same interpretation of the obj format into their new company and that is why they interoperate so well together. Other applications may not mesh so well. I did send an (almost trivial) example non-working object and TG scene to Jo along with assets.

Thank you for treating your customers so well. Planetside is an excellent company!

PabloMack

#20
Quote from: jo on April 11, 2014, 01:18:16 AMI sent you an email a bit earlier today. The file you sent me loads fine on Windows and the Mac. I was wondering if it also works for you if load the same thing you sent me.

Do I understand you correctly that the textures are displaying correctly in TG on your machine? If that is the case then there has to be something different (i.e. wrong) with my installation. The NoTexture.tif image shows you what I am seeing.

[LATER]

I just tried loading what I sent you and this time the cube is all black.

jo

Hi,

I've attached what I get. This is rendered on the Mac but I got the same results on Windows. I think it comes down to those slightly weird relative paths in the file. I need to set up a test of my own to try and replicate them to fully understand what's going on.

TG does a pretty comprehensive search for image files specified in MTL files, because there are so many variations of how paths are specified. On my machines the files are being found because one of the searches TG does is to look in the same folder as the MTL file for a file with a matching name, disregarding the rest of the file path. Something you might try with the files you sent me is to open the MTL file in a text editor and change the lines that look like this:

map_Kd E:Greenworks/SimpleBox/RedPlaidTableclothTexture.png

to this:

map_Kd RedPlaidTableclothTexture.png

and then try importing the OBJ again. I would be pretty surprised if that didn't work.

When I get a chance I'll try setting up things on Windows to use relative paths like the MTL file uses and see what happens.

Regards,

Jo

PabloMack

#22
Okay. I think my problem is solved. In my mind, exiting TG and then rerunning it was forcing TG to reload the model. But this is not so. TG "loads" the model and, apparently stores object along with the scene file when you save it. So simply rerunning the scene containing an instance of the object means that TG never looks at the mtl file again. You have to delete the object within TG and then reinsert it again. To be safe, after deleting the object from TG I inserted a different version of the object from a different file and the textures show up properly. I then went back and did the same thing using the absolute paths (with preceding slashes) and the textures show up properly. In the original cabin scene, I didn't want to actually delete the object because I would have lost all of the orientation parameters associated with positioning the object. And I didn't want to insert another instance of the object to copy orientation parameters over before deleting the first instance being afraid that TG would recognize it was coming from the same file and use cached parameters instead of forcing a reload of the same object. So I exited TGand reran it thinking that it would reload the object. But it does not. Now I think I understand what I was doing wrong. My mental model of that part of TG was flawed.

Another thing this clarifies is, since the object is not reloaded simply by rerunning a TG scene that already contains a non-textured object, it stands to reason that an error message would not be generated because a "reload" of the object isn't being done. But I did force a reload of an object that has an mtl file with the absolute paths generated by Lightwave that lack a preceding slash in the path name. TG does not find the image files but also does not report any error. So when I originally loaded the object that had an mtl file with absolute path names that needed to be manually repaired, TG just threw the textures out and recorded that there aren't any textures associated with the object. My TG scene has been carrying that same object through all my tests because I didn't actually delete and reload the object during the whole process.

From now on, after I have generated an obj file using Lightwave or Modo, I will have to edit the preceding slashes into the mtl texture file path names before I insert the object into the TG scene. If I remember to do this I thing I will be okay. This may even clear up a mystery problem that some TG users had long ago and have given up on Lightwave or Modo altogether for model creation thinking that they are generating flawed obj files when they are probably not. Editing the mtl files is really pretty easy. It just has to be done if you want to use either Lightwave or Modo to make your own models.

Problem solved and thanks all for the support. You were all great!

A question I have for Jo is: "If you don't delete the object from the scene I sent you but you do edit the mtl file in the way you describe (file only, no path) then do you see the untextured model when you run TG as I did?" If so then it clarifies things a bit more for me.

PabloMack

#23
I rendered the cabin scene and it looks beautiful. But my problems are still not over. When I first load the scene with the object, I do not get any errors or warnings. But when I render then I get 31 warnings that say: "Part shader 01 contains more than one part node assigned to 'Surface Name'".

I would like to understand what is going on but I still may need to pursue the PoseRay option as others have pointed out. Even after updating my browser to IE10 the PoseRay downloader still complains that my browser is out of date and refuses to go any further in the process. I guess I will force an update to IE11 and see what happens.

bobbystahr

Quote from: PabloMack on April 11, 2014, 10:43:24 AM
I rendered the cabin scene and it looks beautiful. But my problems are still not over. When I first load the scene with the object, I do not get any errors or warnings. But when I render then I get 31 warnings that say: "Part shader 01 contains more than one part node assigned to 'Surface Name'".

I would like to understand what is going on but I still may need to pursue the PoseRay option as others have pointed out. Even after updating my browser to IE10 the PoseRay downloader still complains that my browser is out of date and refuses to go any further in the process. I guess I will force an update to IE11 and see what happens.

I use GoogleChrome and have no probs with PoseRay dl's. Does that error message have any impact on the rendered image?...I sometimes get those and just ignore them as they don't seem to impact the final image.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

PabloMack

#25
Quote from: bobbystahr on April 11, 2014, 12:32:21 PMI use GoogleChrome and have no probs with PoseRay dl's. Does that error message have any impact on the rendered image?...I sometimes get those and just ignore them as they don't seem to impact the final image.

Here's how I look at having a single big corporation having too much control over my life. Microsoft has control of my computer. Google (arguably) has control of my personal information on the Internet. I use Google search a lot and I have a lot on YouTube. So, if I were to start using Chrome, then Google would have control over both my computer and my personal information on the Internet. I'm not going to let that happen. Because Microsoft and Google are big rivals, I draw the line of control at the network interface. And because Google is the looming monster on the horizon with Android threatening to obsolete both Windows and the Mac, I prefer to draw the lines of control where I still have some control. The very fact that the latest IE does not seem to qualify for downloading when even very very old versions of Windows have plenty of downloading capability sends up a red flag. I suspect it is Google working underhandedly and unethically behind the scenes to wrest control of my computer out of the hands of their rival. To me, that is not just possible, it is probable.

What I think I will do with that issue is to install Chrome on one of the computers that I only use for special purposes. But if the download looks at me funny then I will wipe that computer clean and reinstall everything. It wasn't very long ago that I installed a bunch of malware in a process in which I thought I was installing Adobe Reader. That really pissed me off. It took me the better part of a day to wipe everything and reinstall everything on that computer again. If that had happened on my main system it would have been a disaster. If all I can do is install that utility on a rarely used computer to make sure it doesn't do something like that to my main system I will. Its the malware that doesn't present itself that I have most to worry about. Some installers use the Internet to download the resources during the install.

That said, the messages in the error panel are only warnings. So far I have not noticed any problems with the renders so your assertion appears to be correct.

bobbystahr

Quote from: PabloMack on April 11, 2014, 01:17:26 PM

To me, that is not just possible, it is probable.



That said, the messages in the error panel are only warnings. So far I have not noticed any problems with the renders so your assertion appears to be correct.


re: probable...I have days I feel like that as well...I just accepted the mark of the beast as a lot of my music friends use gmail...I use as little M$ as I can get away with and am a few more quirks from Red Hatting the whole shebang...I'd get a mac but am not that rich...
I have little problem with malware since I started using the open source ClamWin antivirus...got a trojan denial of service and couldn't get online to find a fix so after 2 days of not being able to upload my auto update they snuck in around the trojan, gave me a new version which I dl'd and installed and bye bye trojan...smart program. They also make a mac flavour.
Try Chrome on a special comp anyway...it's the fastest, most reliable browser I've ever used; and kind cool once y' get used to the minimal interface...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

PabloMack

#27
Quote from: bobbystahr on April 11, 2014, 01:53:17 PM...I just accepted the mark of the beast as a lot of my music friends use gmail...

You made me laugh. I have heard of many people having gmail but I have never thought of it in that context. I guess it never entered my radar screen. Probably back in the days when the Internet was just getting to its feet, the old folgies probably had such notions about Yahoo, gmail and WebCrawler. Anyway, there are probably a lot of people who never even heard of  "the mark of the beast" outside of recent popular scifi/horror films. Personally, I grew up in an environment where my nose was rubbed in apocalyptic doctrine and teachings almost every day. My mother (God rest her soul) just passed away a month ago today. But the memories will stay with me...until...I guess until I get Alzheimers or a Mack truck; whichever gets me first.  ;)

P.S. Apologies to Europeans for the American idiom who have never heard of a Mack Truck. Please substitute "Leyland Lorry" and, at least the British will know what I am talking about. We often use the expression "being hit by a Mack Truck" as a pretty sure way to die. http://en.wikipedia.org/wiki/Mack_Trucks

bobbystahr

#28
Quote from: PabloMack on April 11, 2014, 04:14:26 PM
Quote from: bobbystahr on April 11, 2014, 01:53:17 PM...I just accepted the mark of the beast as a lot of my music friends use gmail...

You made me laugh.
Anyway, there are probably a lot of people who never even heard of  "the mark of the beast" outside of recent popular scifi/horror films. Personally, I grew up in an environment where my nose was rubbed in apocalyptic doctrine and teachings almost every day.

My mother (God rest her soul) just passed away a month ago today. But the memories will stay with me...until...I guess until I get Alzheimers or a Mack truck; whichever gets me first.  ;)


"In dark times make light of IT" is my current motto so I'm happy to incite levity

I grew up Pentecostal my self; Pente-Coastal now, heh heh heh at least till I get a working mac....

Mine passed a decade gone now but still inspires me to greater heights...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Oshyan

Terragen loads the MTL file once, yes, but the "object" (the actual geometry) IS loaded every time you either load the scene or exit and open Terragen. The MTL file is loaded once and converted to Terragen's native node interpretation of what it finds in the MTL. So IF you then save that TGD file and re-load it, any changes to the MTL of the source object will not be recognized unless you delete and reload the MTL. This allows Terragen to preserve any changes you make to the texturing and generally to the nodes overall, which is a good thing. But I can understand how it creates some confusion. Probably a specific "reload material definitions from disk" or "from MTL" would be good.

Re: browser, why not try Firefox? A lot more privacy-oriented and less problematic than Chrome in that regard (though I use both).

- Oshyan