Wall Worm Forums

Design Tools => Materials and Textures => Topic started by: EgrOnWire on March 17, 2017, 03:39:34 PM

Title: VMF Export Wrong texture scaling
Post by: EgrOnWire on March 17, 2017, 03:39:34 PM
WallWorm VMF exporter messes up with texture scaling on UVW maps.
Every texture is exactly 8 times smaller than it should be.

Scene units set up as 1u = 1 inch.

In Max, texture looks like this:
(https://www.wallworm.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FSc3H3IY.png&hash=698e5dfb5e2ea0f21c2a2af3695239ee84d5d9c6)
(https://www.wallworm.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FydlZF4A.png&hash=d95678e4fd2b0ad98c23122ff8789f058172c59c)

When exported into hammer it appears scaled exactly 8 times larger:
(https://www.wallworm.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F2vSEZyP.png&hash=2150caaa5657b633d471aab9ab03a985791235f6)

Texture scales are 14 on x and y, if divided by 8, they appear as they were in 3ds max, except the offsets are also wrong.
(https://www.wallworm.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FjLTHFXs.png&hash=d441a6216534c87d9b498e66ef2da504151713d1)

Title: Re: VMF Export Wrong texture scaling
Post by: Joris Ceoen on March 17, 2017, 05:09:24 PM
I think I've had this problem before, and I never knew an exact reason as of why this happened. I did however fix this often by attaching it with a nearby brush (that did export correctly before). Sometimes then, if you detach those again into their original state, they will all of a sudden work.

You can always test my suggestion out, it's been a while since I've been in the tools but at least that's what I remember that fixed it.
Title: Re: VMF Export Wrong texture scaling
Post by: EgrOnWire on March 17, 2017, 05:13:49 PM
Quote from: Joris Ceoen on March 17, 2017, 05:09:24 PM
I think I've had this problem before, and I never knew an exact reason as of why this happened. I did however fix this often by attaching it with a nearby brush (that did export correctly before). Sometimes then, if you detach those again into their original state, they will all of a sudden work.

You can always test my suggestion out, it's been a while since I've been in the tools but at least that's what I remember that fixed it.

The problem is, any brush is scaled like that, 8 times larger than it should be.
Title: Re: VMF Export Wrong texture scaling
Post by: wallworm on March 17, 2017, 07:06:19 PM
I'll need to see the actual file. Please click File > Save As... Archive and send the zip file to me. I'll see what's causing the problem for you.
Title: Re: VMF Export Wrong texture scaling
Post by: EgrOnWire on March 17, 2017, 07:30:46 PM
Here, the map itself.
Title: Re: VMF Export Wrong texture scaling
Post by: wallworm on March 17, 2017, 07:54:12 PM
In order for me to really test, I need all the textures to. Using the archive function outlined above will package all files used in the scene.
Title: Re: VMF Export Wrong texture scaling
Post by: EgrOnWire on March 17, 2017, 08:22:17 PM
Here they are, uploading to Dropbox because of filesize limits.

https://dl.dropboxusercontent.com/s/838lk8r02796s2b/issue_packed.zip
Title: Re: VMF Export Wrong texture scaling
Post by: wallworm on March 17, 2017, 09:23:55 PM
OK, I've replicated the error from your scene.

Before I explain the fix, I want to point out that the file units should be set to Generic instead of US Standard. This is not related to the current issue, but I want to make note of that before I go further.

There is a default value of size of 64x64 on all brush faces at export time. During the export WW looks up for the actual dimensions of the bitmap on faces to override those defaults and set the correct scaling. Any bitmap that is not found will get that scaling.

The odd thing here is that the bitmaps are obviously available here. For some reason Max is telling WW that the bitmaps are undefined. I do not know yet if this is bad logic in WW or a bug in Max. In any event, here is how I got the scene to export properly:


If the Make Path Absolute isn't available, then first make the paths relative to the project folder first with the same right-click method above, then the Make Absolute will be available.

I am going to have to investigate this issue with relative paths.
Title: Re: VMF Export Wrong texture scaling
Post by: wallworm on March 17, 2017, 10:15:32 PM
I found a solution to this issue. If you update WW I suspect the UVs will be correct now.
Title: Re: VMF Export Wrong texture scaling
Post by: EgrOnWire on March 18, 2017, 04:50:32 AM
Thank you for quick support response. Everything exports fine now.
Beign a dev myself, i know how its hard to fix strange bugs, so i really appreciate your help.
Title: Re: VMF Export Wrong texture scaling
Post by: wallworm on March 18, 2017, 08:22:34 AM
Thanks for the kind words. I look forward to seeing what you create! Please share your adventures as you get going on your projects :)