PDA

View Full Version : UV from Lightwave to Unity - not displaying correctly.



Paul_Boland
12-27-2018, 02:58 PM
Hi Folks.

I'm trying to take this stone wall segment from Lightwave into Unity. In Lightwave, the UV mapping is fine, looks great. But in Unity 3D it is displayed incorrectly. Does anyone have any ideas what is wrong here?

Ztreem
12-27-2018, 05:06 PM
How does your UV look in LW can you take screenshot? What format do you use to export to unity? Remember to setup the uv map in the color channel in lw before export.

Paul_Boland
12-27-2018, 06:06 PM
There is a screenshot above showing it in Lightwave and Unity. Looks fine in Lightwave but is weird in Unity. I export FBX. I do believe the UV is setup correctly in the colour channels since it appears fine in Lightwave. Thanks for the help, appreciated, but got any other ideas?

Rayek
12-27-2018, 06:18 PM
Could you share the fbx with us to inspect?

Ztreem
12-27-2018, 06:27 PM
I only see the grid in uv view no geometry. Be sure in unity to use uv from object and not to generate a new one. If you can share the object we can take a look. I never had any issues with uv’s from LW to unity.

Paul_Boland
12-27-2018, 06:30 PM
Here you go, thanks for your time.

Ztreem
12-27-2018, 06:36 PM
Here you go, thanks for your time.

I check it tomorrow. Time for bed now.

Rayek
12-27-2018, 07:36 PM
I opened your LWO object in Accutrans and Modeler, and no issues with the LWO. The FBX UVmap is all wrong, though. I opened the FBX in Blender, and it looks like some of the uv vertices collapsed to adjacent vertices.

You have multiple UV maps: Unity only supports up to two per object. Delete all uvmaps, and create one UV map, and map all your faces to that texture. It should work then.

Rayek
12-27-2018, 07:56 PM
I also noticed multiple materials. You only need one, right? One material, one uvmap.

Rayek
12-27-2018, 08:04 PM
Here is the corrected version.
143705

Paul_Boland
12-27-2018, 08:24 PM
Ok, thanks for this, it is appreciated. I'm totally new to UV mapping so obviously I don't know what I'm doing. I tried following a tutorial on YouTube but I'm getting weird results. Let me mess around with it a bit more and see if I can figure it out...

Paul_Boland
12-28-2018, 09:37 AM
Right, I'm trying to apply a single UV map to the model in Lightwave and the map is just not working. I get one polygon side mapped, and it wipes out the others. I have applied the texture, WallUV, to the model, and then used Make UVs tell each face what I want it to be on the texture image, but as you can see from the image below it's not working:

143708

I have attached my Lightwave model here, can someone please tell me what I'm doing wrong?

Rayek
12-28-2018, 10:26 AM
Drop the selection (if any), and use Make UVs-->Map Type:Atlas. 25% Relative Gap Size.

Then move, rotate and scale each polygon in place so each one covers the texture the way you want.

Nowadays I've grown so used to Blender UV'ing together with the Textools addon... Feels strange to be UV'ing in Modeler once more. I've become SO slow in it! Feels like wading through mud.

MonroePoteet
12-28-2018, 10:39 AM
Well, I'm certainly no expert at UV Mapping, but in this case you'll probably have better luck using an Atlas UV Map type. The Atlas UV Map type separates out each polygon in the geometry, allowing you to move / rotate / stretch it to apply the portion of the UV Map image you want.

A basic understanding of UV Maps is that it associates a geometric point with an offset into the Texture image. U is left-to-right and V is bottom-to-top. If a geometric point is mapped to UV(0,0), that's the lower-left hand corner of the image, UV(1,1) is the upper-right corner, UV(0,.5) is the left edge halfway up, etc. The grid in the UV Texture View shows the (0,0) to (1,1) mapping, allowing you to place polygons or points anywhere within the Texture image.

To analyze your existing model, I loaded it into Modeler (LW2018.0.7), set the upper left view to UV Texture (as you did), and then select polygons in the UV Texture View rather than in the orthogonal views. In the model you posted, all the square polygons have the same UV map and it's hard to change what the UV coordinates for each polygon are:

143711

To apply the UV Map "correctly", I deleted the existing UV Map Texture, and then used Atlas to create a new one called StoneBox. This results in a *separate* mapping of each square polygon which can be manipulated separately:

143712

By selecting a single polygon in the UV Texture View, it is highlighted in the orthogonal views so you know which specific geometry polygon you're working with:

143713

You can then, move, stretch or even rotate the polygon in the UV Texture view to apply the specific portion / size / aspect ratio of the Image you want:

143714

You then unselect that polygon, select the next one, and repeat the UV placement for each polygon:

143715

Each polygon can have a different set of UV coordinates for mapping the image:

143716 143717

I mapped each of the polygons uniquely just to show the capabilities:

143718 143719

MOV File: 143720

Of course, manual placement of each polygon's UV coordinates in the UV Texture view is the "brute force" approach and depending on the model's shape and orientation of each of the polygons, more efficient / automated methods may be available. But understanding that you *can* do manual placement of individual polygons allows fine-tuning of even an automatically-placed polygon. Many people recommend unwelding the points of the polygons to avoid edge artifacts as you move it about the Texture image.

mTp

P.S. For the truly hardcore, you can see the specific UV coordinates for any point in the model using the Point Info panel (i):

143721

Rayek
12-28-2018, 10:53 AM
Yes, that is exactly how I did it in Modeler. It seems really slow, though: in Blender I choose "unwrap", and all selected polygons fit the texture exactly and overlap one another. Then it is just a matter of rotating a couple with R and typing 90 or 180. Takes less than 20 seconds to do.

Is there a way in Modeler to quickly place all faces automatically and snap to the texture size?

Rayek
12-28-2018, 11:01 AM
PS I exported the wall object with the corrected UV map to a Collada file, and opened it in Godot (which I prefer over Unity). The UVs were correct, and the texture behaved just like the one in Modeler. Which means it will work in Unity as well.

Paul_Boland
12-28-2018, 01:56 PM
Very much appreciate this this, folks, it works great. I still have a lot to learn about using UV maps but this helps a lot, thanks!!

Kryslin
12-28-2018, 03:46 PM
If the texture image is the same for all faces, you can select those faces, and use a simple planar mapping for that axis. The UV mapped face will fill the entire domain. You then select the faces that are backwards, and flip U & V coordinates as needed to correct.

Rayek
12-28-2018, 04:18 PM
If the texture image is the same for all faces, you can select those faces, and use a simple planar mapping for that axis. The UV mapped face will fill the entire domain. You then select the faces that are backwards, and flip U & V coordinates as needed to correct.

True, although still very laborious. No way to select all faces and map those in one action to the texture domain then?

Kryslin
12-28-2018, 05:14 PM
Not that I'm aware of, unfortunately. Manual UV mapping isn't my strong suit. Sounds like a job for a script of some kind...

Ztreem
12-28-2018, 05:50 PM
I actually think there is a tool for that, don’t remember its name and I’m not at any computer right now so I can look it up.

XswampyX
12-29-2018, 09:01 AM
Yes, that is exactly how I did it in Modeler. It seems really slow, though: in Blender I choose "unwrap", and all selected polygons fit the texture exactly and overlap one another. Then it is just a matter of rotating a couple with R and typing 90 or 180. Takes less than 20 seconds to do.

Is there a way in Modeler to quickly place all faces automatically and snap to the texture size?

Yep!


https://youtu.be/GZhgyisbmck

Rayek
12-29-2018, 03:09 PM
@XswampyX Your method to delete the existing uvmaps is rather cumbersome. A much faster way is to open the Vertex Maps panel, and twirl down the Texture entry. Then select all maps, and right-mouse click to delete them. Then create a new UV map.

Good to see that there's a way to map all faces to the entire texture domain, though.

Now, the next issue I had was to assign all faces to the same surface, and remove the remaining assigned surfaces. I discovered that in 2018 a new option exists: Detail-->Reassign Surface. But we still can't seem to just quickly delete those superfluous surfaces in the Surface Editor, it seems?

There's an interesting thread about this: https://forums.newtek.com/showthread.php?139547-Rename-multiple-selected-surfaces-in-the-Surface-Editor/page3

Seems like a plugin exists to take care of this - although I really think such basic functionality should be part of the native tool set. Unless I am missing something again, and I am at fault for not finding the solution.

In the end I decided not to bother, open the object in Blender, delete all existing surfaces and uvmaps, select all faces, and it takes one click to create a new uvmap with the correct mapping. Rotate some of the UVs, and export to FBX.

Import in Modeler, and the object has one surface material. Done! :-)

Does anyone know how to merge and/or delete the existing surfaces in the Surface Editor? Or is a plugin/script required?

XswampyX
12-29-2018, 03:26 PM
@XswampyX Your method to delete the existing uvmaps is rather cumbersome. A much faster way is to open the Vertex Maps panel, and twirl down the Texture entry. Then select all maps, and right-mouse click to delete them. Then create a new UV map.

Good to see that there's a way to map all faces to the entire texture domain, though.

Now, the next issue I had was to assign all faces to the same surface, and remove the remaining assigned surfaces. I discovered that in 2018 a new option exists: Detail-->Reassign Surface. But we still can't seem to just quickly delete those superfluous surfaces in the Surface Editor, it seems?

There's an interesting thread about this: https://forums.newtek.com/showthread.php?139547-Rename-multiple-selected-surfaces-in-the-Surface-Editor/page3

Seems like a plugin exists to take care of this - although I really think such basic functionality should be part of the native tool set. Unless I am missing something again, and I am at fault for not finding the solution.

In the end I decided not to bother, open the object in Blender, delete all existing surfaces and uvmaps, select all faces, and it takes one click to create a new uvmap with the correct mapping. Rotate some of the UVs, and export to FBX.

Import in Modeler, and the object has one surface material. Done! :-)

Does anyone know how to merge and/or delete the existing surfaces in the Surface Editor? Or is a plugin/script required?

Any unassigned surfaces get deleted on saving.. so just reload it.

Rayek
12-29-2018, 03:35 PM
Aahhh... Right. Thanks.

Ma3rk
12-29-2018, 04:40 PM
Hey all,

I understand you're UV pain & confusion. The native tools in Modeler are uh, well,... I guess you've found out by now. There are a few 3rd party tools out there that help such as those from plg, but when your starting out with this stuff it's hard to even know what you need, or even trying to achieve. To confuse matters more, there are multiple ways of skinning that proverbial cat.

Earlier this year, I was introduced to a UV tool that's apparently been around for awhile, but has really taken off recently in its being noticed. This isn't a sales pitch but rather an urging to take a look at thier vids & simply see what all is possible.

https://www.youtube.com/channel/UCIeLTW-_QouhXYL1pL45Zug

And yes, I've found having Rizom really does take the anguish out of making & modifying UV's (it's actually kinda fun), but it's a bit pricey; ~ $175 for a perpetual license.

But my point is that just seeing how it's used & approaches UV maniipluation in general should, I'd think, help in using the tools available in LW.

Rayek
12-29-2018, 04:56 PM
It's funny, because I haven't had to deal with Uv'ing in Modeler for years now, and coming back to them feels like (as already mentioned) wading with your lower body through a swamp of mud. It didn't seem that bad all those years ago. Times have progressed, though.

I've looked into Rizom last month, and while it seems quite powerful, my work is mostly limited to games, and Blender + the free Textools addon (also available for Max) are really quite fluent and quick to work with. And more than sufficient. Rizom is a tad expensive, to be honest. Great for AAA work. But beyond what I require.

Lightwave is not alone in regards to outdated UV'ing tools, though: C4D can be added to that list as well. Seems many users rely on third-party tools to do their more complex uv'ing jobs.

Ztreem
12-29-2018, 06:12 PM
Now, the next issue I had was to assign all faces to the same surface, and remove the remaining assigned surfaces. I discovered that in 2018 a new option exists: Detail-->Reassign Surface. But we still can't seem to just quickly delete those superfluous surfaces in the Surface Editor, it seems?


You should be used to this concept of save and reload to delete things as a Blender user. :D

Rayek
12-29-2018, 11:08 PM
You should be used to this concept of save and reload to delete things as a Blender user. :D

Only with fake users! :)