Skip to content

A standalone program built on the Valve Resource Format (VRF) and Source 2 Viewer CLI tools to export the collision models of vmdl/.dmx files and combine coplane faces into an obj file. Primarily for the purpose of porting Counter-Strike Source Surf maps to the Source 2 engine. ramps

License

Notifications You must be signed in to change notification settings

Chent-AU/vmdl-collision-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VMDL_C Converter

Contents

Purpose

This program was developed to allow easier clipping of prop ramps for CS2 porting. This program allows .vmdl_c files to be converted to obj files, and in the process will merge triangular faces (coplanar faces). These models can then be easily imported using file->import into hammer directly, and then the faces can be used to clip prop ramps very easily.

It will convert ramps like this:

Alt text

Into ramps like this:

Alt text

Requirements

This program uses the CLI version of Source2Viewer to decompile the .vmdl_c files, and thus can only be run on windows. It is entirely CPU based, it does not require any raytracing and thus has no GPU requirements.

Guide

  1. Find your base game directory (e.g. "F:/Program Files (x86)/Steam/steamapps/common/Counter-Strike Global Offensive")

Alt text

  1. Select your output directory (Where you want the obj files to be placed)

Alt text

  1. Select an addon from the list, and click extract models.

Alt text

  1. Select which models you want to convert to obj

Alt text

  1. Adjust your export settings.
    • A vmdl may be made up of 2 parts, a physics hull for calculating collisions, and a render hull for appearance, or it may just have a single hull that does both. Typically you will want to export the physics hull for the purpose of clipping, but sometimes the physics hull may not include the entire ramp, or may be missing segments, in which case the combined model can be very useful, but beware it may sometimes have duplicate faces (identical faces on top of one another). The program will attempt to remove these duplicate faces, but if they are slightly misaligned then it will be unable to do so.
    • You may select to snap the verticies of the model to a grid size, this can help in removing duplicate faces.
    • The coplanar angle threshhold adjusts how similar two triangular faces have to be to be merged, typically 0.99 is fine, if you export your model and notice the faces are still triangular, try lowering this value.

Alt text

  1. Click Convert Models and then import your model into hammer when they are completed via File -> Import File.

Alt text

  1. Find the ramp prop entity you want to add the clip surface to, and copy the transform information to your clipboard.

Alt text Alt text

  1. Then find your imported clip mesh, it will have no material and thus will be easy to spot. And paste the transform information.

Alt text Alt text

Your ramps should now be perfectly aligned like so:

Alt text

  1. From here, you should select the faces you want to use as a clip, then use (in this order) Detach Faces (N) and then Extract Faces (Alt + N), apply the toolsplayerclip.vmat material and then select the mesh of the other faces and delete them.

Alt text Alt text

  1. Now you can delete any duplicate faces, and overlap the edges, thicken the faces and adjust the physics types as per the CS2 Surf Mapping Guide to complete the ramp clip.

Alt text Alt text

About

A standalone program built on the Valve Resource Format (VRF) and Source 2 Viewer CLI tools to export the collision models of vmdl/.dmx files and combine coplane faces into an obj file. Primarily for the purpose of porting Counter-Strike Source Surf maps to the Source 2 engine. ramps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages