Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: T-Man on January 26, 2014, 09:51:48 am

Title: Trouble with importing models + textures in blender.
Post by: T-Man on January 26, 2014, 09:51:48 am
I've had an issue in Blender for a while and i was wondering if someone might know what command or setting I’m missing? Been looking around tutorial but couldn't find any covering importing model parts.

I've got the latest Blender running as-it-comes (so haven't tweaked any settings, beyond turning on the Collada import/export capability) and modelling in it has been going alright (hence my Ballista model topic), but whenever i try to import a finished model through a Collada saved in PCS2 (such as TVWP's Atlas bomber, shown in the picture below) I find the model appears with no textures (if I go into texture mode, the whole model is white). I do notice the materials section has material entries for each texture, but on the advice of RGANoris' old tutorial (which I used to guide initial Blender try-outs) I ignore these and load the textures via the UV editor. The results are what are confusing me a lot.

(http://i913.photobucket.com/albums/ac334/Murasaki_Tatsu/Hard%20Light/Misc/th_BlenderUVIssue_zps2671581b.png) (http://s913.photobucket.com/user/Murasaki_Tatsu/media/Hard%20Light/Misc/BlenderUVIssue_zps2671581b.png.html)

If I just load a texture without selecting model faces, it just loads the texture fine (here it's a TGA but it works with DDS too) and doesn’t place them on the model, as if it hasn't been UV-mapped. If I select model faces in edit mode then select/load the texture, it'll give every selected face that texture regardless of whether the texture was intended to be there or not, but faces that were intended to have that texture show them correctly (hence the missile bank front and cockpit in the picture being correct). It will also show any selected faces on the UV-Map, seemingly arranged as if properly mapped, but misaligned with the texture in the UV-image editor (so according to the editor they aren’t lined up, yet in the main view itself they are; in pic above), and it won't let me realign them if i try to (i move it and it'll move straight back).

I also found when i tried the Custos in BP that in it's case the UVs were aligned right over the image, but were far bigger than the texture as if the texture was wrongly scaled (see below, before selection on left and after on right). It's so messy I assume because I selected the whole model and it's loading up every UV for every texture.
(http://i913.photobucket.com/albums/ac334/Murasaki_Tatsu/Hard%20Light/Misc/th_BlenderUVIssue2_zps4266969c.png) (http://s913.photobucket.com/user/Murasaki_Tatsu/media/Hard%20Light/Misc/BlenderUVIssue2_zps4266969c.png.html)(http://i913.photobucket.com/albums/ac334/Murasaki_Tatsu/Hard%20Light/Misc/th_BlenderUVIssue3_zps045d63c4.png) (http://s913.photobucket.com/user/Murasaki_Tatsu/media/Hard%20Light/Misc/BlenderUVIssue3_zps045d63c4.png.html)
Texturing is my last major hurdle with Blender and I’ve been really hoping to get into modelling with it for projects like TVWP and U-War, so I’d it'd mean a lot if anyone may know whatever it is I’m missing here; I assume there is some import settings I haven't set somewhere, or I'm doing something wrongly? My hope was to be able to load textures and have their UV's already there set and applied on the model so I could modify it from there.

Cheers for your time.
Title: Re: Trouble with importing models + textures in blender.
Post by: Kopachris on January 26, 2014, 10:16:29 am
If all you're looking for is importing models into Blender with textures, I already have a script that can do that.  If your textures are in the ../maps directory from the .pof file (so, laid out like FS2's /data folder), it will import the textures and even use the -glow, -shine, and -normal maps.

Main disadvantages, though: The rest of the script is woefully incomplete (paths and a few other "helpers" will import, but most are missing), it won't create a PCS2-compatible .dae if you export it again, and the direct .pof export script doesn't do anything other than geometry and textures yet.  If all you're doing is texturing and UV-mapping, though, it might work.  Actually, if that's all you're doing, you should be able to just deselect everything except "submodels", "geometry", and "textures" in the exporter's options and save it with the same name as the existing .pof.  It should open the existing file and only update the parts of the file it needs to, leaving the rest intact.  It's untested, though (and still under development), so I won't guarantee it.

The link is https://github.com/Kopachris/bpof if you're interested.  Just drop the io_scene_pof folder in your Blender plugins directory.