Convert Scene to Model
If you need to convert a scene to a single model (or large sections of a scene) you can use the Convert Scene to Model utility. The tool is found in Wall Worm > Wall Worm Model Tools > Convert Scene to Model.
When you run the function, the tool can collapse the targeted objects (scene or sub-selection) into a single object, delete most tool texture faces, weld vertices and create a WWMT Helper for the object to export as a model. This tool was intended as a replacement for Propper (converting imported VMF files into models) but can be used on arbitrary scenes.
Converting Scenes to Models
The conversion process if generally straightforward. But there are a few considerations when re-exporting. First, there are a couple global settings that you should set before starting:
- Click Wall Worm > Wall Worm Settings
- Open the Models Tab
- Turn on Full Material Names
- Set the Normals drop-down to Explicit Normals ( this will slow down exports if you do not have WW Pro, but is necessary if you are collapsing Models).
Simple Steps for Converting
- Open Convert Scene to Model
- Select Objects in Scene to convert
- Set the Convert option to Convert
- Set relevant options (like Weld, Delete Faces with Tool Textures, Convert Models and Generate Collision Hull).
- Click Do It.
- Repeat on next set of objects to convert
Exporting the Model(s)
For the most part, exporting the model itself should be as simple as selecting the WWMT Helpers generated in the scene and clicking Wall Worm > Wall Worm Exporters > Export WWMT To Source Models. But before you do that, you must address some issues with the materials.
If the scene was imported from a VMF file, then it is very likely that many of the materials are not proper materials for models. You will have to either create new materials or edit the existing materials.
Presuming you want to keep the materials separate, follow these steps.
- Open the Material Editor (M)
- Use the pick Material button and select your model
- Open each material on the object and change the shader from LightMappedGeneric to VertexLitGeneric; if there are displacements using WorldVertexTransition or 4Way blends, you'll need to use a new material because there is no equivalent for models.
- Change the name of each material to something appropriate--because we do not want this new material to overwrite the original brush materials. If the material has a value in the $cdmaterials field, set it to the path where you want the VMT to get generated at or clear the $cdmaterials field.
- Export the Model's Materials by selecting the WWMT Helper and clicking Wall Worm > Wall Worm Exporters > Export Selected Model Textures.
Because there is a limit on how many materials that are allowed on a single model, you may also consider baking the model's material into a single material with Render To Texture. Doing this will reduce texture quality on large models.
Exporting the Model
Re-Exporting the model is fairly straightforward. If the model contains materials that you do want to re-use (because they were VertexLitGeneric to begin with) and they are not currently found in the target Material Path of the WWMT Helper, you will need to change a global setting before exporting: Wall Worm > Wall Worm Settings > Models > Full Material Names.
Now select the WWMT Helpers and click Wall Worm > Wall Worm Exporters > Export WWMT To Source Models.
Explanation of User Interface
Choose the objects to convert: Selected Objects or the Entire Scene.
- Skip Hidden
Skip all hidden objects in the new model.
- Skip Import Layers
Skip objects that are part of hidden Utility Layers that WW creates during QC imports.
- Convert Models
Include model props. When off, ignores objects of the WallWormMDL class.
- Convert Displacements
When off, skips displacement objects. If you convert displacements, you will need to do extra work for baking blends.
- Delete Faces with Tool Textures
Delete the faces of the model with textures that have the word "Tool" in them.
- Weld Verts
Weld the vertices of the model.
- Create WWMT
Generate a WWMT Helper with the resulting model to re-export into Source
- Pivot to Origin
Place the model's pivot at the world origin.
- Create Collision Hulls
Generate a Hull from each Element of the model. Warning: this can be slow with large scenes!
- Delete Objects that Cannot Convert
Delete skipped objects from the scene. Do not do this if there are objects you need to keep like entities.