Collision Recipes and batch

A recipe is an ordered list of steps that turns a mesh into collision. Apply one to a selection of Static Meshes from the Content Browser, from a script, or with the CPApplyRecipe commandlet. Recipes are editor assets and are stripped from cooked games.

Apply a recipe from the Content Browser

  1. Select one or more Static Meshes, right-click and open Apply Collision Recipe.
  2. Optionally tick Replace All Collision and/or Dry Run. Toggling one keeps the submenu open so you can set both.
  3. Pick a built-in recipe, or Choose Recipe Asset… for your own.

The run happens in the background. A notification such as “Applying Prop: 2 of 6 meshes done” has a Cancel button, the editor stays usable, and each mesh is baked as soon as its result arrives. Several meshes generate at once (one worker per core beyond the two the editor needs, at most 8), and a free worker starts the next mesh straight away. Cancel keeps the meshes already baked and leaves the rest unchanged.

  • Dry Run generates and reports without changing any collision.
  • Replace All Collision removes every simple shape, not only the plugin’s own.
  • Both apply to the next run only and switch themselves off afterwards (a cancelled picker leaves them off). The result says whether either was used.

The results window

Collision Recipe Results: 3 succeeded, 0 failed, 0 skipped, total time 27.720 s, Dry Run No, Replace All Collision No. Rows: Launcher 27 elements, Rifle 19, Target 2, all Succeeded. Buttons: Export CSV, Copy, Close.
The Prop recipe applied to three template props that shipped without collision.

When a run ends the notification turns into a summary and the non-modal Collision Recipe Results window opens: one row per mesh with Asset, Result, Elements, Vertices, Time and Details. Click a header to sort; double-click a row, or right-click > Show in Content Browser, to find the asset. Export CSV…, Copy and Close are at the bottom.

  • A row is a Warning only for a real warning. Notes that describe how the collision was produced, such as “Disconnected closed components are decomposed independently” (every multi-part mesh reports it) or “The hull count limit required exceeding the requested concavity threshold”, appear in Details and leave the row Succeeded.
  • Vertices counts convex elements only, so a row of boxes reads 0.
  • The CSV keeps the columns Asset,Success,Cancelled,Hulls,Seconds,Message; Message includes warnings and notes.

Built-in recipes

These are starting budgets, not guarantees for a particular vehicle, building or VR interaction. Test thin walls, openings and gameplay contacts on representative assets.

RecipeIdentifierSettings
PropPropDefault CoACD budgets (2,000 samples, 60 search iterations, depth 3) with preprocessing and primitive preference.
VehicleVehicle48 hulls, threshold 0.035, 64 vertices; primitive preference.
BuildingBuilding64 hulls, negative-space protection with a 20 cm radius; Native backend.
VR GrabbableVRGrabbable16 hulls, threshold 0.025, primitive tolerance 0.1 cm.
WalkableWalkable64 hulls, threshold 0.02, negative-space radius 10 cm; Native backend and sampled walkable-clearance protection.

Prop on a concave mesh can take from several seconds to tens of seconds per mesh. Lower the budgets in a custom recipe for faster turnaround.

The Walkable recipe

Walkable uses a 45° slope, a 180 cm sampling height and a 0.25 cm clearance tolerance, capped at 1,024 deterministic samples. Each closed part is oriented outward and decomposed separately by Native under one shared hull budget; flat parts become thin slabs. The recipe validates the clearance again after later Inflate, Merge or Simplify steps, and skips merges or primitive replacements that would block it. A mesh that needs more than 64 convex elements to keep its clearance returns an explicit error and no collision; raise the budget in a custom recipe. Sampling is not a navigation proof: check your navmesh and character on the result.

Custom recipes

Create a recipe asset (class CP Collision Recipe) from the Content Browser’s Add menu, add steps, and pick it with Choose Recipe Asset…. Steps run in order on a working result:

StepEffect
ClearRemoves the working result.
AutoDecomposeAdds convex elements from the step’s decomposition settings.
FitPrimitivesAdds a fitted primitive of the step’s Primitive Type.
PreferPrimitivesReplaces convex elements by primitives where they fit within tolerance.
MergeMerges neighbouring elements within a geometric tolerance. Inspect openings after changing it.
SimplifySimplifies the elements.
InflateGrows (or, while dimensions stay valid, shrinks) shapes by Amount, in centimetres.
SetFlagsApplies Collision Enabled and Contribute to Mass to the generated shapes.
C++ (editor module): an ordered box recipe
#include "Batch/CPRecipeRunner.h"

FCPRecipeStep Fit;
Fit.Operation = ECPRecipeOperation::FitPrimitives;
Fit.PrimitiveType = ECPHullType::Box;

FCPRecipeStep Inflate;
Inflate.Operation = ECPRecipeOperation::Inflate;
Inflate.Amount = 0.25; // 0.25 cm on each side, 0.5 cm added to the full box dimensions

FCPRecipeStep Flags;
Flags.Operation = ECPRecipeOperation::SetFlags;
Flags.CollisionEnabled = ECollisionEnabled::QueryOnly;
Flags.bContributeToMass = false;

FCPCollisionResult Preview = FCPRecipeRunner::Generate(MeshSnapshot, {Fit, Inflate, Flags});

The CPApplyRecipe commandlet

Run a dry run first and review the CSV. Replace the paths with your own engine and project; use absolute report paths when launching from another working directory.

PowerShell
& 'C:/Program Files/Epic Games/UE_5.7/Engine/Binaries/Win64/UnrealEditor-Cmd.exe' 'D:/Projects/Game/Game.uproject' `
  -run=CPApplyRecipe -Recipe=Prop -Paths=/Game/Props -Recursive -DryRun `
  -Report=D:/Reports/prop-preview.csv -unattended -nullrhi
ArgumentMeaning
-Recipe=A built-in identifier (Prop, Vehicle, Building, VRGrabbable, Walkable) or an asset object path, for example /Game/Collision/CR_Vehicle.CR_Vehicle.
-Paths=Content paths, comma-separated. Add -Recursive for subfolders.
-DryRunCompute and report without changing collision. Leave it out to apply and save.
-ReplaceAllReplace the whole simple-collision set. Without it, unrelated manual collision is kept.
-Report=CSV report path.
-Timeout=A cooperative budget in seconds for the whole batch (0, the default, means none). Cancellation reports all remaining assets and applies no partial results.

No matching meshes, a missing recipe, failed generation or failed saves give a nonzero exit status; a report that cannot be written returns 2.

From scripts

UCPEditorScriptingLibrary::ApplyRecipe (also usable from Editor Utility Blueprints and Python) and FCPRecipeRunner::Run run the same batch with a cancellable progress dialog and block until done; the commandlet uses the same path without a dialog. See Scripting and API reference.

Applies to Collider Painter 1.0.0. Report a problem with this page.

Esc

Type to search the documentation.

↑ ↓ moveEnter openEsc close