Skip to content

RomekRF/RF-Vehicle-Tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RF Vehicle Tools

Blender add-on for importing and exporting Red Faction V3M vehicles. No 3ds Max required.

⚠️ Early development. This add-on works for basic single-mesh single-LOD vehicle export and round-trips stock files cleanly, but it has not been battle-tested on a wide variety of custom vehicles. Expect rough edges. Bug reports welcome.

Companion to VFX_Exporter, RF-Character-Tools, and RF-Static-Mesh-Tools. Use this one when you want to make custom vehicles (jeeps, APCs, fighters, subs, drillers).

What it does

  • Import stock and custom V3M vehicles back into Blender, with prop points and collision spheres restored as parented empties
  • Export vehicles to game-ready V3M files matching stock format byte-for-byte conventions
  • Built-in templates for Jeep, APC, Fighter, Sub, Driller, and Gun Attachment that drop the standard prop points and collision spheres in the right places
  • bbox_offset is auto-computed from the mesh bounding box so meshes built around any pivot still align with their PPs and cspheres in-game
  • Vehicle render flags 0x00518C41 applied automatically (matches stock, differs from the static mesh tool)
  • Validator with smart material/texture name resolution from shader nodes
  • "Apply Mesh Transforms (Keep Children)" operator that uses Apply-to-Deltas under the hood, so empties don't snap to origin
  • "Generate entity.tbl Snippet" button to scaffold the vehicle definition for the game

Install

  1. Download the latest release zip from the Releases page
  2. In Blender, go to Edit > Preferences > Add-ons > Install...
  3. Select the zip and enable "RF Vehicle Tools"
  4. Open the sidebar in the 3D viewport (press N) and look for the RF Vehicle tab

Tested on Blender 4.x and 5.x.

Quick start (custom vehicle)

  1. Build your vehicle mesh in Blender, oriented so the front of the vehicle points along Blender -Y (matches how stock jeep imports — same convention as the other RF tools)
  2. In the RF Vehicle sidebar tab, pick a template that matches your vehicle type (Jeep, APC, Fighter, Sub, Driller) and click Apply Template — this drops the standard prop points and collision spheres parented to your active mesh
  3. Adjust the prop point and csphere positions to fit your model
  4. (Optional) Apply your mesh transforms with the Apply Mesh Transforms (Keep Children) button so the Properties panel shows clean zeros without your empties snapping to origin
  5. File > Export > Red Faction Vehicle V3M (.v3m) and save into your user_maps or mod directory
  6. Use the Generate entity.tbl Snippet button to get a starting entity.tbl entry, then drop the snippet into your mod's entity.tbl

Notes on entity.tbl flags

The "jeep" flag in $Flags triggers hardcoded engine behavior that requires PP_interface_2 (gunner seat) to exist in the V3M. If you want a single-seater, either keep the empty around (tucked inside the body is fine) or drop the "jeep" flag and clear the weapon entries:

$Flags:                 ("walk" "crusher" "collide_corpse")    // no "jeep"
$Allowed Weapons:       ()
$Default Primary:       ""
$Default Secondary:     ""

PP_jeep_gun itself is optional — the engine handles it being missing. CS_csphere04 (upper body collision sphere) appears optional too. Test before shipping.

Format details

The V3M vehicle format follows V3C-style per-LOD submesh layout. Per-LOD prop points are embedded at the tail of the LOD data block. Collision spheres live at file scope as CSPH sections (44 bytes each). The bbox_offset field stores the translation from mesh-local origin to vehicle pivot — the exporter computes this automatically, the importer applies it on load so things align in Blender.

Coordinate conversion uses the established RF convention (matches the character and static mesh tools): (x,y,z)_RF → (-x, -z, y)_BL for positions, with quaternions and triangle winding flipped accordingly. Triangle winding flips on import AND export because the position transform has determinant -1 (reflection).

Known limitations

  • No LOD support yet — exports a single LOD. Suitable for most custom vehicles. (LOD distances are managed in entity.tbl anyway.)
  • No multi-submesh export. Stock vehicles use a single submesh; if you need multiple, this isn't the tool yet.
  • Animated/articulated vehicles (drillers with moving drills) export the static mesh fine but you'll need separate work for the animation.
  • Templates are based on stock Jeep positions verified against Jeep01.v3m. APC/Fighter/Sub/Driller template positions are educated guesses and may need manual tweaking.
  • No corona orientation auto-fix. If your headlights point the wrong direction in-game, select PP_corona_1/PP_corona_2 in Blender and Alt+R to clear rotation, then re-export.

Contributing

Bug reports and PRs welcome. If a stock V3M imports incorrectly or your custom export crashes RED, attach the .v3m file to an issue.

License

MIT — see LICENSE for details.

Credits

Built by RomekRF with help from Claude (Anthropic). Format reverse-engineering verified against stock Red Faction PC vehicles.

image image image image

About

Blender add-on for importing and exporting Red Faction V3M vehicles.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages