View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005326||DarkRadiant||Models||public||11.08.2020 09:19||12.08.2020 21:04|
|Summary||0005326: Exporting .obj lacks .mtl; UV is inverted; scale by 2.54 ?|
|Description||When exporting parts of the map as .obj file, there is no .mtl for material/texture info. This would be very useful to know what exactly should be used.|
Another issue is that .obj files appear to have inverted UV.
Would it be possible to add scale on export?
|Tags||model, model export|
UE4Editor_nsCsa8UL6k.png (1,448,147 bytes)
Thanks for stopping by!
I'm not very proficient when it comes to handling OBJ files - can you give me a few more directions? Like a working .OBJ and .MTL file, or a comparison of expected and actual results when using the export? Then I can try to fix it.
Thanks for your response! I didn't expect it so fast.
Format is purely text based.
I guess you will have to read materials from radiant, and parse that into .mtl file. Here is a 1 object sample with one material applied .OBJ:
[CODE]# Blender v2.83.2 OBJ File: ''
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 1.000000
vt 0.625000 0.500000
vt 0.875000 0.500000
vt 0.875000 0.750000
vt 0.625000 0.750000
vt 0.375000 0.750000
vt 0.625000 1.000000
vt 0.375000 1.000000
vt 0.375000 0.000000
vt 0.625000 0.000000
vt 0.625000 0.250000
vt 0.375000 0.250000
vt 0.125000 0.500000
vt 0.375000 0.500000
vt 0.125000 0.750000
vn 0.0000 1.0000 0.0000
vn 0.0000 0.0000 1.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
f 1/1/1 5/2/1 7/3/1 3/4/1
f 4/5/2 3/4/2 7/6/2 8/7/2
f 8/8/3 7/9/3 5/10/3 6/11/3
f 6/12/4 2/13/4 4/5/4 8/14/4
f 2/13/5 1/1/5 3/4/5 4/5/5
f 6/11/6 5/10/6 1/1/6 2/13/6
And here is corresponding .MTL file:
# Blender MTL File: 'None'
# Material Count: 1
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Long story short, map_Kd/Kn/Ks correspond to matching diffuse/normal/specular textures. When this is included, all textures should load automatically.
As for inverting UV, that's going to be a lot of numbers I think. I could probably export sample brush from Radiant, fix it in Blender, and then show you final .obj so you can see the differences for yourself.
Is there any discord for more real-life communication?
TEMP.zip (762 bytes)
|Oh I can't edit it now, but obviously instead of "Material", it should actually using corresponding material name. I think in Doom 3 case it's always the color map filename?|
Thanks for the examples. Anything that I can compare to is helpful. I'm not sure myself right now, but does Doom 3 handle OBJ files? Or are you using some other engine?
Don't hold your breath on the fix though, I'm currently tied up in other things, so it might be a while.
My final destination is UE4, however once this is implemented, it would literally work with every 3D software like Maya, Blender, Unity, 3DS Max...
The current file is fully workable, just requires manual rework of inverting UV and recreating materials.
I haven't looked into materials in Radiant, been a while since I really dipped into that, but maybe at the very least it would be possible to put all 'shaders' into a single text file to ease this process? Just text information about material name and textures it's using. Many materials are using filename + suffixes like _d _local _s, but not everything is matching.
|Possibly related to my experience with the UVs at https://bugs.thedarkmod.com/view.php?id=4099#c7853|
|The steampowered link you have posted is dead. Do you have a copy of its content?|
I'm afraid I didn't find anything in the Wayback Machine. But I remember that when I tried loading an OBJ from DR into UVMapper Classic it popped up an offer to fix it automatically, and that was all it took to make it usable in Sculptris's paint mode. Probably the 'message about out of range UV coordinates' mentioned in http://www.render-lab.com/Render-Lab_UV_tut.htm and https://community.foundry.com/discuss/topic/41014/solved-uv-out-of-range-with-uv-mapper?mode=Post&postID=371929
|11.08.2020 09:19||elojalapeno||New Issue|
|11.08.2020 09:19||elojalapeno||Tag Attached: model|
|11.08.2020 09:19||elojalapeno||Tag Attached: model export|
|11.08.2020 09:19||elojalapeno||File Added: UE4Editor_nsCsa8UL6k.png|
|11.08.2020 14:06||greebo||Note Added: 0012721|
|11.08.2020 14:06||greebo||Status||new => feedback|
|11.08.2020 17:45||elojalapeno||Note Added: 0012723|
|11.08.2020 17:45||elojalapeno||File Added: TEMP.zip|
|11.08.2020 17:45||elojalapeno||Status||feedback => new|
|11.08.2020 17:46||elojalapeno||Note Added: 0012724|
|11.08.2020 17:52||greebo||Note Added: 0012725|
|11.08.2020 17:52||greebo||Status||new => acknowledged|
|11.08.2020 17:54||elojalapeno||Note Added: 0012726|
|12.08.2020 14:24||VanishedOne||Note Added: 0012730|
|12.08.2020 18:54||elojalapeno||Note Added: 0012731|
|12.08.2020 21:03||VanishedOne||Note Added: 0012732|
|12.08.2020 21:04||VanishedOne||Note Edited: 0012732||View Revisions|