Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.81 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.81 KB

Yet Another VMF Converter

A simple converter for basic map geometry of VMF files.

Blender Helpers

UVMap/Vertex Color Channel names

As each solid is its own mesh (or more if the sides have different materials), you eventually want to join most generated meshes into larger ones. But as each uv map and vertex color channel is assigned a unique name, merging these objects will fail. To allow lossless merging of meshes, run this script first to give all channels of the selected objects the same name, which allows Blender to merge them properly.

import bpy

for obj in bpy.context.selected_objects:
    try:
        for uvmap in obj.data.uv_layers:
            uvmap.name = "UVMap"
        try:
            layer, *_ = obj.data.vertex_colors.values()
            layer.name = "VCol"
        except ValueError:
            pass
    except AttributeError:
        pass

Blender Texture Blending

To properly use "texture blending" using the provided displacement alpha data, first set up a group for blending different materials like this.

blending group

Then use it like this (note that the source shaders are grouped, because they are used without blending in other materials, which allows changing parameters by just editing the group).

Blending material

Entity Placement

Use this included blender script to create empties in your blender file for every prop_static and prop_dynamic entity. These empties are named according to the referenced models and their assigned skins, they have their viewport colors set to their render colors (allowing rgb mixing for rendering), and they are prepared for collection instancing (i.e., you only need to insert the correct collection containing the appropriate model).