Having trouble with exporting my materials...

Started by Rapid99, August 20, 2012, 06:03:27 AM

Previous topic - Next topic

Rapid99

Hi there!

I do a lot of media work for machinimas and such, and used to do a ton of work with Source. I took a break for a while, but i'm starting to come back to working with source (I mainly did a lot of work in Hammer)

Anyway, my most recent project of mine involves converting models ripped from a game using the Unreal engine, and converting them for use in Source.
I have the models ripped, imported, textured and ready to go. Thanks to your fantastic tool, converting these should be a walk in the park, however, I hit a bit of a snag.

When I get to the export stage, I can export the models perfectly. The batch file shows up in my modelsrc folder, and the 7 model files for source pop up in my cstrike models folder (and are working, as I can view them, untextured... with that hideous pink and black checkerboard)

However, whenever I try to export the textures, I get an error...



There were errors. Please read the following notes:

##########################

*The texture was not exported. The main reasons are that MAXScript does not have permission to write to your Materialsrc folder or Steam is not running.

--Runtime error: FileStream cannot create:
\materials\myproject\Material_118.vmt

Make sure that the folder for this material exists in your materialsrc folder in SDK.


So, that's my issue :/

Details I can provide:

1. Steam is, in fact, running.
2. 3DS Max is updated to the most recent version, with all service packs installed.
3. I have created the appropriate folder within 'materialsrc' inside my SDK folder.
4. My current export option paths are set to...
modelsrc: sdk_content\cstrike\modelsrc
materialsrc: sdk_content\cstrike\materialsrc
maprsrc: sdk_content\cstrike\mapsrc
Bin Dir: sourcesdk\bin\orangebox\bin
Game Info: Clear
[NOTE: I have also tried changing the Bin Dir to read from the EP1 bin instead of orange box. No joy.]


I don't know what to do at this point v.v
I'm so close, considering I have the model itself exported. I just need to get it textured...

Jeeze, and this is just my first one. I have a few hundred to convert xD i'm sure once I get my issue sorted out though, the rest will be a breeze.

Thanks again, hope we can get this sorted out!

wallworm

I think I know the issue.

Starting in WWMT Version 1.85 (released on August 6), the Game Info Dir is no longer optional because of changes to the way WW creates VMT files. Previously, WW would let VTEX generate them... but this had a lot of problems and limitations because it forced VMT files to be in specific paths based on the diffuse texture... blah blah blah :)

Anyway, the latest versions require you to set the Game Info Dir. That is the only way for WW to know where to write the VMT files.

Unfortunately, I have not had time to update the docs about this. It is mentioned in the changelog for ver. 1.85.

I will be updating WW to stop you from even trying to export materials without that (I've already added it to the WW code) but if it doesn't stop you and you have the latest release (1.855) then it is still in my development version.

Infidel

Not to piggy back/ Hi jack someone else's post but could this be the reason I do not have VMTs for my recently exported model textures?

wallworm

That's a very good possibility. The version I'm releasing later today* will alert you to this situation and tell you to set it.

*Maybe today.

Rapid99

#4
Thanks a lot worm! Solved one problem, but now I have another ._.

By setting the game's info directory to cstrike, it allowed me to export the textures.

However, looking at the model, it is still untextured or pink/black.

Looking in my materials folder, it created 4 folders...
"myproject", which is the name of the folder I told it to export to.
And 2 "Map_xx" folders.

Each map folder has a single low res .vtf file in it, and the "myproject" folder has a .vmt

Normally, models have their reference materials inside of single folder in "materials/models/ModelName" or something, with 1 or more .vtfs, and usually each .vtf has it's own .vmt

Does your program export in a different format, or did I mess up something D:

wallworm

The resolutions of the VTFs are always determined by the resolution of the TGA/PSD they come from. So if the original TGA is low-res, so will the VTF be.

You do have control of the compression in the Material Export ... each model stores the compression in the compression menu for each model ... the default (empty) uses the Valve default of DXT3. You can also choose DXT5 or no compression. Those affect file size and quality, but do not affect resolution (which, again, is controlled by the source bitmap).

The lastest material settings output bitmaps into folders based on the Bitmap Node in the material editor. The name of the node (not the filename but the node) controls the output path of bitmaps (vtfs). *

The VMT file is the only file that has to be in a specific path for a model. The VMT (material) will always be placed in the Material Folder Path for your model. The name of the VMT file is based off of the Name of the Material in the Material Editor. **

* Note that the bitmap output path methods described here are a new way of doing this. I still have a legacy method that you can turn on in the WW Settings called  Legacy VTF.

** The name of the face material is also a new method and IS ONLY SUPPORTED IN THE WWMT SMD Exporter. If you are using the Wunderboy SMD Exporter or Cannonfodder's exporter in WW, you need to switch to the legacy version--in which case open the WW Settings and turn on Legacy Tex Names.

***********************

Just a note for reference, many of the features I've been adding lately (and am about to add tonight or sometime this week) require using the WWMT SMD Exporter to work properly as there are features that are not yet available in the other SMD Exporters. This is especially true of an update coming in next release that fixes problems with offset models in CS:GO and SFM.

Rapid99

Ah, gotcha. I'll have to give this a try when I get home tonight :] (bout to step out to go to work)

Thank you though, i'll post again of course if I run into any other questions or errors.

Rapid99

#7
Alright, making progress!

Few more questions that (I hope) should be pretty general.

First of all, by simply ticking off "Legacy VTF" and "Legacy Tex Names", I ended up with the texture being applied to the model properly.


But now I have two different questions:

1. EDIT: I lied, normal maps are working. I was ticking / unticking the wrong checkbox, lol.
2. Opacity maps: Anything special here as well? The opacity map didn't apply at all, nor was it exported with the materials (wasn't even an option)

Without the two, the model now looks like this o.o



I tried unticking "Translucent Only if Diffuse in Opacity", aka adding "$translucent" to the vmt file... instead, that just made the entire model have opacity...



I also tried "$alphatest" but that just made the entire model invisible, lol.

It's probably something i'm doing in 3DS that i'm overseeing (i'm not all too used to 3DS Max, or it's material editor), or maybe something that has to be done after the fact. But if there is anyway you could help, then having this last thing figured out should solve the last of my problems :D

wallworm

In the future, you may want to turn those options back off and switch to the WW SMD Fallback Exporter as they are more robust... which I will document soon.

In Source, the Alpha must come from the alpha channel of the diffuse bitmap (not a separate bitmap). In WW, this will happen automatically if the diffuse bitmap has an alpha channel*.

*The caveat is that the MAXScript detection for ALpha detects alpha for bitmaps if it has an alpha channel at all--regardless of whether you specifically created alpha. That is why there is a global WW setting for Materials called Translucent Only if Diffuse in Opacity. When that setting is on, alpha will only be sent to Source if the same bitmap is piped into both the diffuse and opacity slot.

Regarding normals... they normally export just fine. Depending on the normal map resolution and the model detail, they don't always show up in the model viewer well. The only way to truly tell is to compile a level with them lit and see if it is coming out fine.

Rapid99

I did a ninja edit but you replied too quickly. *shakes fist* lol.

The normal maps ARE working, I was just unticking "Normals" and not "Normal Maps", so mistake on my end.

The Alpha channels ARE in a separate texture file. So I will give that a shot. I'll (hopefully) just load up PS, import the separate texture as the alpha channel, and then re-assign it in 3DS and see if it works.

Thanks! I'll post again if there's another issue (or if it works, either way)

:D

wallworm

You can also do that all directly in the material editor (no need to go to PS) ... just takes learning how to mix some maps and use the Render Map function. I don't have time tonight to explain more... but it's worth learning.

Rapid99

Alright, everything is working on my end :] thanks a million.



Now all I have to do is learn is animated models and textures at some point, and i'll be back in the groove :3

Thanks again, Worm!

wallworm

Glad you got it working. Since you are ripping, you'll find the batch exporting convenient. For single mesh props, use the Models Tab in Anvil and use the Quick WWMT button on a multitude of props and the Quick Compile on them once turned into WWMT helpers.

SMF spam blocked by CleanTalk